Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 18 additions & 16 deletions src/PassKit/PKShareablePassMetadata.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,58 +6,60 @@

namespace PassKit {

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

#if NET
/// <summary>This enum describes how to interpret some arguments when creating <see cref="PKShareablePassMetadata" /> instances.</summary>
[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 {
/// <summary>The 'templateIdentifier' parameter identifies a card template identifier.</summary>
Template = 0,
/// <summary>The 'templateIdentifier' parameter identifies a card configuration identifier.</summary>
Configuration = 1,
}

#if NET
/// <summary>Create a new <see cref="PKShareablePassMetadata" /> instance.</summary>
/// <param name="credentialIdentifier">The credential identifier for the new <see cref="PKShareablePassMetadata" /> instance.</param>
/// <param name="sharingInstanceIdentifier">The sharing instance identifer for the new <see cref="PKShareablePassMetadata" /> instance.</param>
/// <param name="templateIdentifier">The card template identifier for the new <see cref="PKShareablePassMetadata" /> instance.</param>
/// <param name="preview">The preview for the new <see cref="PKShareablePassMetadata" /> instance.</param>
[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
/// <summary>Create a new <see cref="PKShareablePassMetadata" /> instance.</summary>
/// <param name="credentialIdentifier">The credential identifier for the new <see cref="PKShareablePassMetadata" /> instance.</param>
/// <param name="sharingInstanceIdentifier">The sharing instance identifer for the new <see cref="PKShareablePassMetadata" /> instance.</param>
/// <param name="templateIdentifier">The template identifier for the new <see cref="PKShareablePassMetadata" /> instance.</param>
/// <param name="preview">The preview for the new <see cref="PKShareablePassMetadata" /> instance.</param>
/// <param name="cardType">Specifies whether the <paramref name="templateIdentifier" /> parameter specifies a card template identifier or a card configuration identifier.</param>
[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),
InitializeHandle (_InitWithCardTemplate (credentialIdentifier, sharingInstanceIdentifier, templateIdentifier, preview),
"initWithProvisioningCredentialIdentifier:sharingInstanceIdentifier:cardTemplateIdentifier:preview:");
break;
case CardType.Configuration:
InitializeHandle (InitWithCardConfiguration (credentialIdentifier, sharingInstanceIdentifier, templateIdentifier, preview),
InitializeHandle (_InitWithCardConfiguration (credentialIdentifier, sharingInstanceIdentifier, templateIdentifier, preview),
"initWithProvisioningCredentialIdentifier:sharingInstanceIdentifier:cardConfigurationIdentifier:preview:");
break;
default:
throw new ArgumentOutOfRangeException (nameof (cardType));
}
}
}
#endif // !TVOS && !WATCH
#endif // !TVOS
}
4 changes: 2 additions & 2 deletions src/passkit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1940,12 +1940,12 @@ interface PKShareablePassMetadata {
[Internal]
[iOS (16, 0), Mac (13, 0), MacCatalyst (16, 0), NoWatch, NoTV]
[Export ("initWithProvisioningCredentialIdentifier:sharingInstanceIdentifier:cardTemplateIdentifier:preview:")]
NativeHandle InitWithCardTemplate (string credentialIdentifier, string sharingInstanceIdentifier, string templateIdentifier, PKShareablePassMetadataPreview preview);
NativeHandle _InitWithCardTemplate (string credentialIdentifier, string sharingInstanceIdentifier, string templateIdentifier, PKShareablePassMetadataPreview preview);

[Internal]
[iOS (16, 0), Mac (13, 0), MacCatalyst (16, 0), NoWatch, NoTV]
[Export ("initWithProvisioningCredentialIdentifier:sharingInstanceIdentifier:cardConfigurationIdentifier:preview:")]
NativeHandle InitWithCardConfiguration (string credentialIdentifier, string sharingInstanceIdentifier, string templateIdentifier, PKShareablePassMetadataPreview preview);
NativeHandle _InitWithCardConfiguration (string credentialIdentifier, string sharingInstanceIdentifier, string templateIdentifier, PKShareablePassMetadataPreview preview);

[Export ("credentialIdentifier", ArgumentSemantic.Strong)]
string CredentialIdentifier { get; }
Expand Down
5 changes: 0 additions & 5 deletions tests/cecil-tests/Documentation.KnownFailures.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16784,8 +16784,6 @@ F:PassKit.PKSecureElementPassActivationState.Activating
F:PassKit.PKSecureElementPassActivationState.Deactivated
F:PassKit.PKSecureElementPassActivationState.RequiresActivation
F:PassKit.PKSecureElementPassActivationState.Suspended
F:PassKit.PKShareablePassMetadata.CardType.Configuration
F:PassKit.PKShareablePassMetadata.CardType.Template
F:PassKit.PKShareSecureElementPassErrorCode.SetupError
F:PassKit.PKShareSecureElementPassErrorCode.UnknownError
F:PassKit.PKShareSecureElementPassResult.Canceled
Expand Down Expand Up @@ -41948,8 +41946,6 @@ M:PassKit.PKRecurringPaymentRequest.#ctor(System.String,PassKit.PKRecurringPayme
M:PassKit.PKServiceProviderDataCompletionResult.#ctor(Foundation.NSData)
M:PassKit.PKShareablePassMetadata.#ctor(System.String,System.String,CoreGraphics.CGImage,System.String,System.String,System.String,System.String,System.String,System.Boolean)
M:PassKit.PKShareablePassMetadata.#ctor(System.String,System.String,System.String,CoreGraphics.CGImage,System.String,System.String)
M:PassKit.PKShareablePassMetadata.#ctor(System.String,System.String,System.String,PassKit.PKShareablePassMetadataPreview,PassKit.PKShareablePassMetadata.CardType)
M:PassKit.PKShareablePassMetadata.#ctor(System.String,System.String,System.String,PassKit.PKShareablePassMetadataPreview)
M:PassKit.PKShareablePassMetadataPreview.#ctor(CoreGraphics.CGImage,System.String)
M:PassKit.PKShareablePassMetadataPreview.#ctor(System.String)
M:PassKit.PKShareablePassMetadataPreview.PreviewWithPassThumbnail(CoreGraphics.CGImage,System.String)
Expand Down Expand Up @@ -75147,7 +75143,6 @@ T:PassKit.PKSecureElementPass
T:PassKit.PKSecureElementPassActivationState
T:PassKit.PKServiceProviderDataCompletionResult
T:PassKit.PKShareablePassMetadata
T:PassKit.PKShareablePassMetadata.CardType
T:PassKit.PKShareablePassMetadataPreview
T:PassKit.PKShareSecureElementPassErrorCode
T:PassKit.PKShareSecureElementPassResult
Expand Down
3 changes: 0 additions & 3 deletions tests/introspection/ApiSelectorTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1290,9 +1290,6 @@ protected virtual bool SkipInit (string selector, MethodBase m)
case "initWithMinCenterCoordinateDistance:":
case "initExcludingCategories:":
case "initIncludingCategories:":
// PassKit
case "initWithProvisioningCredentialIdentifier:sharingInstanceIdentifier:cardTemplateIdentifier:preview:":
case "initWithProvisioningCredentialIdentifier:sharingInstanceIdentifier:cardConfigurationIdentifier:preview:":
// NSImage
case "initWithDataIgnoringOrientation:":
var mi = m as MethodInfo;
Expand Down