Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PassKit] Update bindings for Xcode 14 beta 1-5 #15613

Merged
merged 12 commits into from
Aug 12, 2022
73 changes: 72 additions & 1 deletion src/PassKit/PKEnums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,77 @@ public enum PKAddSecureElementPassErrorCode : long {
UnavailableError,
InvalidConfigurationError,
DeviceNotSupportedError,
DeviceNotReadyError
DeviceNotReadyError,
OSVersionNotSupportedError,
}

[NoWatch, NoTV, NoMac, iOS (16,0), MacCatalyst (16,0)]
[Native]
public enum PKIdentityButtonLabel : long
{
VerifyIdentity = 0,
Verify,
VerifyAge,
Continue,
}

[NoWatch, NoTV, NoMac, iOS (16,0), MacCatalyst (16,0)]
[Native]
public enum PKIdentityButtonStyle : long
{
Black = 0,
Outline,
}

[NoWatch, NoTV, NoMac, iOS (16,0), MacCatalyst (16,0)]
[Native]
[ErrorDomain ("PKIdentityErrorDomain")]
public enum PKIdentityError : long
{
Unknown = 0,
NotSupported = 1,
Cancelled = 2,
NetworkUnavailable = 3,
NoElementsRequested = 4,
RequestAlreadyInProgress = 5,
InvalidNonce = 6,
InvalidElement = 7,
}

[iOS (16,0), Mac (13,0), Watch (9,0), NoTV, MacCatalyst (16,0)]
[Native]
[ErrorDomain ("PKShareSecureElementPassErrorDomain")]
public enum PKShareSecureElementPassErrorCode : long
{
UnknownError,
SetupError,
}

[iOS (16,0), MacCatalyst (16,0), NoWatch, NoTV, NoMac]
[Native]
public enum PKShareSecureElementPassResult : long
{
Canceled,
Shared,
Failed,
}

[iOS (16,0), Mac (13,0), Watch (9,0), NoTV, MacCatalyst (16,0)]
[Native]
public enum PKVehicleConnectionErrorCode : long
{
Unknown = 0,
SessionUnableToStart,
SessionNotActive,
}

[iOS (16,0), Mac (13,0), Watch (9,0), NoTV, MacCatalyst (16,0)]
[Native]
public enum PKVehicleConnectionSessionConnectionState : long
{
Disconnected = 0,
Connected,
Connecting,
FailedToConnect,
}
}
64 changes: 64 additions & 0 deletions src/PassKit/PKShareablePassMetadata.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
using System;
using Foundation;
using ObjCRuntime;

#nullable enable

namespace PassKit {

#if !TVOS && !WATCH
public partial class PKShareablePassMetadata
{

#if NET
[SupportedOSPlatform ("ios16.0")]
[SupportedOSPlatform ("macos13.0")]
[SupportedOSPlatform ("maccatalyst16.0")]
[UnsupportedOSPlatform ("tvos")]
#else
[iOS (16,0), Mac (13,0), MacCatalyst (16,0)]
#endif
public enum CardType {
Template = 0,
Configuration = 1,
}

#if NET
[SupportedOSPlatform ("ios16.0")]
[SupportedOSPlatform ("macos13.0")]
[SupportedOSPlatform ("maccatalyst16.0")]
[UnsupportedOSPlatform ("tvos")]
#else
[iOS (16,0), Mac (13,0), MacCatalyst (16,0)]
#endif
public PKShareablePassMetadata (string credentialIdentifier, string sharingInstanceIdentifier, string templateIdentifier, PKShareablePassMetadataPreview preview) :
this (credentialIdentifier, sharingInstanceIdentifier, templateIdentifier, preview, CardType.Template)
{
}

#if NET
[SupportedOSPlatform ("ios16.0")]
[SupportedOSPlatform ("macos13.0")]
[SupportedOSPlatform ("maccatalyst16.0")]
[UnsupportedOSPlatform ("tvos")]
#else
[iOS (16,0), Mac (13,0), MacCatalyst (16,0)]
#endif
public PKShareablePassMetadata (string credentialIdentifier, string sharingInstanceIdentifier, string templateIdentifier, PKShareablePassMetadataPreview preview, CardType cardType) : base (NSObjectFlag.Empty)
{
switch (cardType) {
case CardType.Template:
InitializeHandle (InitWithCardTemplate (credentialIdentifier, sharingInstanceIdentifier, templateIdentifier, preview),
"initWithProvisioningCredentialIdentifier:sharingInstanceIdentifier:cardTemplateIdentifier:preview:");
break;
case CardType.Configuration:
InitializeHandle (InitWithCardConfiguration (credentialIdentifier, sharingInstanceIdentifier, templateIdentifier, preview),
"initWithProvisioningCredentialIdentifier:sharingInstanceIdentifier:cardConfigurationIdentifier:preview:");
break;
default:
throw new ArgumentOutOfRangeException (nameof (cardType));
}
}
}
#endif // !TVOS && !WATCH
}
1 change: 1 addition & 0 deletions src/frameworks.sources
Original file line number Diff line number Diff line change
Expand Up @@ -1411,6 +1411,7 @@ PASSKIT_API_SOURCES = \
PASSKIT_SOURCES = \
PassKit/PKCompat.cs \
PassKit/PKPaymentRequest.cs \
PassKit/PKShareablePassMetadata.cs \

# PencilKit
PENCILKIT_API_SOURCEs = \
Expand Down
Loading