-
Notifications
You must be signed in to change notification settings - Fork 520
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 13.0 beta 1, 2 #12299
Merged
mandel-macaque
merged 5 commits into
dotnet:main
from
rachelkang:xcode13.0-passkit-b1-b2
Aug 3, 2021
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
7d4fd1c
[PassKit] Update bindings for Xcode 13.0 beta 1, 2
rachelkang e6ad561
Merge branch 'main' into xcode13.0-passkit-b1-b2
rachelkang 45c09b5
Update based on feedback
rachelkang 5f8ea1f
Add more missing [Catalyst]
rachelkang 8ee31cc
Merge branch 'main' into xcode13.0-passkit-b1-b2
rachelkang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -207,6 +207,11 @@ interface PKPassLibrary { | |
[Watch (6,2), iOS (13,4)] | ||
[Export ("signData:withSecureElementPass:completion:")] | ||
void SignData (NSData signData, PKSecureElementPass secureElementPass, PKPassLibrarySignDataCompletionHandler completion); | ||
|
||
[Async (ResultTypeName = "PKServiceProviderDataCompletionResult")] | ||
[Watch (8,0), iOS (15,0), Mac (12,0), MacCatalyst (15,0)] | ||
[Export ("serviceProviderDataForSecureElementPass:completion:")] | ||
void GetServiceProviderData (PKSecureElementPass secureElementPass, Action<NSData, NSError> completion); | ||
} | ||
|
||
[Static] | ||
|
@@ -345,6 +350,11 @@ interface PKPaymentAuthorizationViewControllerDelegate { | |
[Export ("paymentAuthorizationViewController:didRequestMerchantSessionUpdate:")] | ||
[EventArgs ("PKPaymentRequestMerchantSessionUpdate")] | ||
void DidRequestMerchantSessionUpdate (PKPaymentAuthorizationViewController controller, Action<PKPaymentRequestMerchantSessionUpdate> updateHandler); | ||
|
||
[NoWatch, Mac (12,0), iOS (15,0), MacCatalyst (15,0)] | ||
[Export ("paymentAuthorizationViewController:didChangeCouponCode:handler:")] | ||
[EventArgs ("PKPaymentRequestCouponCodeUpdate")] | ||
void DidChangeCouponCode (PKPaymentAuthorizationViewController controller, string couponCode, Action<PKPaymentRequestCouponCodeUpdate> completion); | ||
} | ||
|
||
[Mac (11,0)] | ||
|
@@ -416,6 +426,11 @@ interface PKShippingMethod { | |
[NullAllowed] // by default this property is null | ||
[Export ("detail")] | ||
string Detail { get; set; } | ||
|
||
[Watch (8,0), iOS (15,0), Mac (12,0), MacCatalyst (15,0)] | ||
[NullAllowed] | ||
[Export ("dateComponentsRange", ArgumentSemantic.Copy)] | ||
PKDateComponentsRange DateComponentsRange { get; set; } | ||
} | ||
|
||
[Watch (3,0)] | ||
|
@@ -446,6 +461,19 @@ interface PKPaymentRequest { | |
[Export ("currencyCode")] | ||
string CurrencyCode { get; set; } | ||
|
||
[NoWatch, Mac (12,0), iOS (15,0), MacCatalyst (15,0)] | ||
[Export ("supportsCouponCode")] | ||
bool SupportsCouponCode { get; set; } | ||
|
||
[NullAllowed] | ||
[NoWatch, Mac (12,0), iOS (15,0), MacCatalyst (15,0)] | ||
[Export ("couponCode")] | ||
string CouponCode { get; set; } | ||
|
||
[Watch (8,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] | ||
[Export ("shippingContactEditingMode", ArgumentSemantic.Assign)] | ||
PKShippingContactEditingMode ShippingContactEditingMode { get; set; } | ||
|
||
[NoMac] | ||
[Deprecated (PlatformName.WatchOS, 4,0, message: "Use 'RequiredBillingContactFields' instead.")] | ||
[Deprecated (PlatformName.iOS, 11,0, message: "Use 'RequiredBillingContactFields' instead.")] | ||
|
@@ -548,6 +576,16 @@ interface PKPaymentRequest { | |
[Static] | ||
[Export ("paymentShippingAddressUnserviceableErrorWithLocalizedDescription:")] | ||
NSError CreatePaymentShippingAddressUnserviceableError ([NullAllowed] string localizedDescription); | ||
|
||
[NoWatch, Mac (12,0), iOS (15,0), MacCatalyst (15,0)] | ||
[Static] | ||
[Export ("paymentCouponCodeInvalidErrorWithLocalizedDescription:")] | ||
NSError GetCouponCodeInvalidError ([NullAllowed] string localizedDescription); | ||
|
||
[NoWatch, Mac (12,0), iOS (15,0), MacCatalyst (15,0)] | ||
[Static] | ||
[Export ("paymentCouponCodeExpiredErrorWithLocalizedDescription:")] | ||
NSError GetCouponCodeExpiredError ([NullAllowed] string localizedDescription); | ||
} | ||
|
||
[Mac (11,0)] | ||
|
@@ -1140,7 +1178,11 @@ interface PKPaymentAuthorizationControllerDelegate { | |
[MacCatalyst (14,0)] | ||
[Export ("paymentAuthorizationController:didRequestMerchantSessionUpdate:")] | ||
void DidRequestMerchantSessionUpdate (PKPaymentAuthorizationController controller, Action<PKPaymentRequestMerchantSessionUpdate> handler); | ||
|
||
|
||
[NoWatch, Mac (12,0), iOS (15,0), MacCatalyst (15,0)] | ||
[Export ("paymentAuthorizationController:didChangeCouponCode:handler:")] | ||
void DidChangeCouponCode (PKPaymentAuthorizationController controller, string couponCode, Action<PKPaymentRequestCouponCodeUpdate> completion); | ||
|
||
[Watch (7,0)][iOS (14,0)] | ||
[MacCatalyst (14,0)] | ||
[Export ("presentationWindowForPaymentAuthorizationController:")] | ||
|
@@ -1171,7 +1213,7 @@ interface PKLabeledValue | |
|
||
[Mac (11,0)] | ||
[Watch (4,3), iOS (11,3)] | ||
[BaseType (typeof (NSObject))] | ||
[BaseType (typeof (PKStoredValuePassProperties))] | ||
[DisableDefaultCtor] | ||
interface PKTransitPassProperties { | ||
|
||
|
@@ -1180,9 +1222,17 @@ interface PKTransitPassProperties { | |
[return: NullAllowed] | ||
PKTransitPassProperties GetPassProperties (PKPass pass); | ||
|
||
[Deprecated (PlatformName.iOS, 15, 0)] | ||
[Deprecated (PlatformName.WatchOS, 8, 0)] | ||
[Deprecated (PlatformName.MacOSX, 12, 0)] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. MacCatalyst? |
||
[Deprecated (PlatformName.MacCatalyst, 15, 0)] | ||
[Export ("transitBalance", ArgumentSemantic.Copy)] | ||
NSDecimalNumber TransitBalance { get; } | ||
|
||
[Deprecated (PlatformName.iOS, 15, 0)] | ||
[Deprecated (PlatformName.WatchOS, 8, 0)] | ||
[Deprecated (PlatformName.MacOSX, 12, 0)] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same, MacCatalyst? |
||
[Deprecated (PlatformName.MacCatalyst, 15, 0)] | ||
[Export ("transitBalanceCurrencyCode")] | ||
string TransitBalanceCurrencyCode { get; } | ||
|
||
|
@@ -1192,6 +1242,7 @@ interface PKTransitPassProperties { | |
[Deprecated (PlatformName.iOS, 14,5, message: "Use 'Blocked' instead.")] | ||
[Deprecated (PlatformName.MacCatalyst, 14,5, message: "Use 'Blocked' instead.")] | ||
[Deprecated (PlatformName.WatchOS, 7,4, message: "Use 'Blocked' instead.")] | ||
[Deprecated (PlatformName.MacOSX, 11,3, message: "Use 'Blocked' instead.")] | ||
[Export ("blacklisted")] | ||
bool Blacklisted { [Bind ("isBlacklisted")] get; } | ||
|
||
|
@@ -1244,6 +1295,8 @@ interface PKSuicaPassProperties | |
[Export ("blacklisted")] | ||
[Deprecated (PlatformName.iOS, 14,5, message: "Use 'Blocked' instead.")] // exists in base class | ||
[Deprecated (PlatformName.WatchOS, 7,4, message: "Use 'Blocked' instead.")] | ||
[Deprecated (PlatformName.MacOSX, 11,3, message: "Use 'Blocked' instead.")] | ||
[Deprecated (PlatformName.MacCatalyst, 14,5, message: "Use 'Blocked' instead.")] | ||
bool Blacklisted { [Bind ("isBlacklisted")] get; } | ||
} | ||
|
||
|
@@ -1278,6 +1331,10 @@ interface PKPaymentRequestUpdate { | |
|
||
[Export ("paymentSummaryItems", ArgumentSemantic.Copy)] | ||
PKPaymentSummaryItem[] PaymentSummaryItems { get; set; } | ||
|
||
[Watch (8,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] | ||
[Export ("shippingMethods", ArgumentSemantic.Copy)] | ||
PKShippingMethod[] ShippingMethods { get; set; } | ||
} | ||
|
||
[Mac (11,0)] | ||
|
@@ -1569,6 +1626,10 @@ interface PKShareablePassMetadata { | |
[Export ("initWithProvisioningCredentialIdentifier:cardConfigurationIdentifier:sharingInstanceIdentifier:passThumbnailImage:ownerDisplayName:localizedDescription:")] | ||
IntPtr Constructor (string credentialIdentifier, string cardConfigurationIdentifier, string sharingInstanceIdentifier, CGImage passThumbnailImage, string ownerDisplayName, string localizedDescription); | ||
|
||
[Watch (8,0), iOS (15,0), Mac (12,0), MacCatalyst (15,0)] | ||
[Export ("initWithProvisioningCredentialIdentifier:sharingInstanceIdentifier:passThumbnailImage:ownerDisplayName:localizedDescription:accountHash:templateIdentifier:relyingPartyIdentifier:requiresUnifiedAccessCapableDevice:")] | ||
IntPtr Constructor (string credentialIdentifier, string sharingInstanceIdentifier, CGImage passThumbnailImage, string ownerDisplayName, string localizedDescription, string accountHash, string templateIdentifier, string relyingPartyIdentifier, bool requiresUnifiedAccessCapableDevice); | ||
|
||
[Export ("credentialIdentifier", ArgumentSemantic.Strong)] | ||
string CredentialIdentifier { get; } | ||
|
||
|
@@ -1586,6 +1647,22 @@ interface PKShareablePassMetadata { | |
|
||
[Export ("ownerDisplayName", ArgumentSemantic.Strong)] | ||
string OwnerDisplayName { get; } | ||
|
||
[Watch (8,0), iOS (15,0), Mac (12,0), MacCatalyst (15,0)] | ||
[Export ("accountHash", ArgumentSemantic.Strong)] | ||
string AccountHash { get; } | ||
|
||
[Watch (8,0), iOS (15,0), Mac (12,0), MacCatalyst (15,0)] | ||
[Export ("templateIdentifier", ArgumentSemantic.Strong)] | ||
string TemplateIdentifier { get; } | ||
|
||
[Watch (8,0), iOS (15,0), Mac (12,0), MacCatalyst (15,0)] | ||
[Export ("relyingPartyIdentifier", ArgumentSemantic.Strong)] | ||
string RelyingPartyIdentifier { get; } | ||
|
||
[Watch (8,0), iOS (15,0), Mac (12,0), MacCatalyst (15,0)] | ||
[Export ("requiresUnifiedAccessCapableDevice")] | ||
bool RequiresUnifiedAccessCapableDevice { get; } | ||
} | ||
|
||
[NoWatch, NoTV] | ||
|
@@ -1858,6 +1935,23 @@ interface PKPaymentRequestMerchantSessionUpdate { | |
PKPaymentMerchantSession Session { get; set; } | ||
} | ||
|
||
[NoWatch, Mac (12,0), iOS (15,0), MacCatalyst (15,0)] | ||
[BaseType (typeof(PKPaymentRequestUpdate))] | ||
[DisableDefaultCtor] | ||
interface PKPaymentRequestCouponCodeUpdate | ||
{ | ||
[Export ("initWithPaymentSummaryItems:")] | ||
[DesignatedInitializer] | ||
IntPtr Constructor (PKPaymentSummaryItem[] paymentSummaryItems); | ||
|
||
[Export ("initWithErrors:paymentSummaryItems:shippingMethods:")] | ||
[DesignatedInitializer] | ||
IntPtr Constructor ([NullAllowed] NSError[] errors, PKPaymentSummaryItem[] paymentSummaryItems, PKShippingMethod[] shippingMethods); | ||
|
||
[NullAllowed, Export ("errors", ArgumentSemantic.Copy)] | ||
NSError[] Errors { get; set; } | ||
} | ||
|
||
[Watch (7,0)][Mac (11,0)][iOS (14,0)] | ||
[MacCatalyst (14,0)] | ||
[BaseType (typeof (NSObject))] | ||
|
@@ -1873,4 +1967,105 @@ enum PKRadioTechnology : ulong { | |
Nfc = 1 << 0, | ||
Bluetooth = 1 << 1, | ||
} | ||
|
||
[Watch (8,0), iOS (15,0), Mac (12,0), MacCatalyst (15,0)] | ||
[BaseType (typeof(NSObject))] | ||
[DisableDefaultCtor] | ||
interface PKDateComponentsRange : NSCopying, NSSecureCoding | ||
{ | ||
[Export ("initWithStartDateComponents:endDateComponents:")] | ||
[return: NullAllowed] | ||
IntPtr Constructor (NSDateComponents startDateComponents, NSDateComponents endDateComponents); | ||
|
||
[Export ("startDateComponents", ArgumentSemantic.Copy)] | ||
NSDateComponents StartDateComponents { get; } | ||
|
||
[Export ("endDateComponents", ArgumentSemantic.Copy)] | ||
NSDateComponents EndDateComponents { get; } | ||
} | ||
|
||
[Watch (8,0), iOS (15,0), Mac (12,0), MacCatalyst (15,0)] | ||
[BaseType (typeof(PKPaymentSummaryItem))] | ||
[DisableDefaultCtor] | ||
interface PKDeferredPaymentSummaryItem | ||
{ | ||
[Export ("deferredDate", ArgumentSemantic.Copy)] | ||
NSDate DeferredDate { get; set; } | ||
} | ||
|
||
[Watch (8,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] | ||
[Native] | ||
public enum PKShippingContactEditingMode : ulong | ||
{ | ||
Enabled = 1, | ||
StorePickup, | ||
} | ||
|
||
[Watch (8,0), iOS (15,0), Mac (12,0), MacCatalyst (15,0)] | ||
[BaseType (typeof(PKPaymentSummaryItem))] | ||
[DisableDefaultCtor] | ||
interface PKRecurringPaymentSummaryItem | ||
{ | ||
[NullAllowed, Export ("startDate", ArgumentSemantic.Copy)] | ||
NSDate StartDate { get; set; } | ||
|
||
[Export ("intervalUnit", ArgumentSemantic.Assign)] | ||
NSCalendarUnit IntervalUnit { get; set; } | ||
|
||
[Export ("intervalCount")] | ||
nint IntervalCount { get; set; } | ||
|
||
[NullAllowed, Export ("endDate", ArgumentSemantic.Copy)] | ||
NSDate EndDate { get; set; } | ||
} | ||
|
||
[Watch (8,0), iOS (15,0), Mac (12,0), MacCatalyst (15,0)] | ||
public enum PKStoredValuePassBalanceType | ||
{ | ||
[Field ("PKStoredValuePassBalanceTypeCash")] | ||
Cash, | ||
[Field ("PKStoredValuePassBalanceTypeLoyaltyPoints")] | ||
LoyaltyPoints, | ||
} | ||
|
||
[Watch (8,0), iOS (15,0), Mac (12,0), MacCatalyst (15,0)] | ||
[BaseType (typeof(NSObject))] | ||
[DisableDefaultCtor] | ||
interface PKStoredValuePassBalance | ||
{ | ||
[Export ("amount", ArgumentSemantic.Strong)] | ||
NSDecimalNumber Amount { get; } | ||
|
||
[NullAllowed, Export ("currencyCode")] | ||
string CurrencyCode { get; } | ||
|
||
[Export ("balanceType")] | ||
string BalanceType { get; } | ||
|
||
[NullAllowed, Export ("expiryDate", ArgumentSemantic.Strong)] | ||
NSDate ExpiryDate { get; } | ||
|
||
[Export ("isEqualToBalance:")] | ||
bool IsEqual (PKStoredValuePassBalance balance); | ||
} | ||
|
||
[Watch (8,0), iOS (15,0), Mac (12,0), MacCatalyst (15,0)] | ||
[BaseType (typeof(NSObject))] | ||
[DisableDefaultCtor] | ||
interface PKStoredValuePassProperties | ||
{ | ||
[Static] | ||
[Export ("passPropertiesForPass:")] | ||
[return: NullAllowed] | ||
PKStoredValuePassProperties GetPassProperties (PKPass pass); | ||
|
||
[Export ("blocked")] | ||
bool Blocked { [Bind ("isBlocked")] get; } | ||
|
||
[NullAllowed, Export ("expirationDate", ArgumentSemantic.Copy)] | ||
NSDate ExpirationDate { get; } | ||
|
||
[Export ("balances", ArgumentSemantic.Copy)] | ||
PKStoredValuePassBalance[] Balances { get; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's a breaking change to remove this API
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I see diffs like
-+ (nullable instancetype)passPropertiesForPass:(PKPass *)pass;
for something that leads to a breaking change, should I just ignore it then?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need more context
+ (nullable instancetype)passPropertiesForPass:(PKPass *)pass;
looks identical to what we already have. I could be because the header moved the definition or duplicated a member in a subclass...
In any case we must find a way to expose new API without breaking changes