diff --git a/src/storekit.cs b/src/storekit.cs index fa25d70097..9a09ab86ea 100644 --- a/src/storekit.cs +++ b/src/storekit.cs @@ -32,6 +32,7 @@ namespace StoreKit { [Wrap ("State", IsVirtual = true)] SKDownloadState DownloadState { get; } + [Deprecated (PlatformName.MacOSX, 10,15, message: "Use 'ExpectedContentLength' instead.")] [Export ("contentLength", ArgumentSemantic.Copy)] NSNumber ContentLength { get; } #else @@ -39,10 +40,15 @@ namespace StoreKit { [Export ("downloadState")] SKDownloadState DownloadState { get; } + [Deprecated (PlatformName.iOS, 13,0, message: "Use 'ExpectedContentLength' instead.")] [Export ("contentLength")] long ContentLength { get; } #endif + [TV (13, 0), Mac (10, 15), iOS (13, 0)] + [Export ("expectedContentLength")] + long ExpectedContentLength { get; } + [Export ("contentIdentifier")] string ContentIdentifier { get; } @@ -204,7 +210,20 @@ namespace StoreKit { [Export ("cancelDownloads:")] void CancelDownloads (SKDownload [] downloads); + [Mac (10, 15), iOS (13, 0)] + [Wrap ("WeakDelegate")] + [NullAllowed] + ISKPaymentQueueDelegate Delegate { get; set; } + [Mac (10, 15), iOS (13, 0)] + [TV (13,0)] + [NullAllowed, Export ("delegate", ArgumentSemantic.Weak)] + NSObject WeakDelegate { get; set; } + + [Mac (10, 15), iOS (13, 0)] + [TV (13,0)] + [NullAllowed, Export ("storefront")] + SKStorefront Storefront { get; } } [BaseType (typeof (NSObject))] @@ -224,14 +243,23 @@ namespace StoreKit { [Export ("productIdentifier")] string ProductIdentifier { get; } - [iOS (6,0)] +#if MONOMAC + [Deprecated (PlatformName.MacOSX, 10,15, message: "Use 'IsDownloadable' instead.")] [Export ("downloadable")] + bool Downloadable { get; } +#elif !XAMCORE_4_0 + [iOS (6,0)] + [Obsolete ("Use 'IsDownloadable' instead.")] bool Downloadable { -#if !MONOMAC - [Bind ("isDownloadable")] -#endif + [Wrap ("IsDownloadable")] get; } +#endif + + [iOS (6,0)] + [Mac (10,15)] + [Export ("isDownloadable")] + bool IsDownloadable { get; } [NoiOS] #if XAMCORE_4_0 @@ -304,6 +332,12 @@ namespace StoreKit { [iOS (11,0)][TV (11,0)][NoMac] [Export ("paymentQueue:shouldAddStorePayment:forProduct:")] bool ShouldAddStorePayment (SKPaymentQueue queue, SKPayment payment, SKProduct product); + + [Mac (10,15)] + [iOS (13,0)] + [TV (13,0)] + [Export ("paymentQueueDidChangeStorefront:")] + void DidChangeStorefront (SKPaymentQueue queue); } [BaseType (typeof (NSObject))] @@ -811,4 +845,29 @@ namespace StoreKit { Introductory, Subscription, } + + [Mac (10,15)] + [iOS (13,0)] + [TV (13,0)] + [BaseType (typeof (NSObject))] + [DisableDefaultCtor] // no `init` but non-null properties + interface SKStorefront { + + [Export ("countryCode")] + string CountryCode { get; } + + [Export ("identifier")] + string Identifier { get; } + } + + interface ISKPaymentQueueDelegate {} + + [Mac (10,15), iOS (13,0)] + [Protocol] + [Model (AutoGeneratedName = true)] + [BaseType (typeof(NSObject))] + interface SKPaymentQueueDelegate { + [Export ("paymentQueue:shouldContinueTransaction:inStorefront:")] + bool ShouldContinueTransaction (SKPaymentQueue paymentQueue, SKPaymentTransaction transaction, SKStorefront newStorefront); + } } diff --git a/tests/xtro-sharpie/iOS-StoreKit.ignore b/tests/xtro-sharpie/iOS-StoreKit.ignore new file mode 100644 index 0000000000..055a39a1e5 --- /dev/null +++ b/tests/xtro-sharpie/iOS-StoreKit.ignore @@ -0,0 +1,2 @@ +## deprecated w/replacement in iOS 6, not version information specific to iOS +!missing-selector! SKProduct::contentVersion not bound diff --git a/tests/xtro-sharpie/iOS-StoreKit.todo b/tests/xtro-sharpie/iOS-StoreKit.todo deleted file mode 100644 index f27f25b541..0000000000 --- a/tests/xtro-sharpie/iOS-StoreKit.todo +++ /dev/null @@ -1,11 +0,0 @@ -!deprecated-attribute-missing! SKDownload::contentLength missing a [Deprecated] attribute -!missing-protocol! SKPaymentQueueDelegate not bound -!missing-protocol-member! SKPaymentTransactionObserver::paymentQueueDidChangeStorefront: not found -!missing-selector! SKDownload::expectedContentLength not bound -!missing-selector! SKPaymentQueue::delegate not bound -!missing-selector! SKPaymentQueue::setDelegate: not bound -!missing-selector! SKPaymentQueue::storefront not bound -!missing-selector! SKProduct::contentVersion not bound -!missing-selector! SKStorefront::countryCode not bound -!missing-selector! SKStorefront::identifier not bound -!missing-type! SKStorefront not bound diff --git a/tests/xtro-sharpie/macOS-StoreKit.ignore b/tests/xtro-sharpie/macOS-StoreKit.ignore index d33cd9fe52..cfc84265f0 100644 --- a/tests/xtro-sharpie/macOS-StoreKit.ignore +++ b/tests/xtro-sharpie/macOS-StoreKit.ignore @@ -1,3 +1,7 @@ +# delegate do not mention macOS (as unavailable) but the non-delegate type is not (available) +!missing-protocol! SKCloudServiceSetupViewControllerDelegate not bound +!missing-protocol! SKStoreProductViewControllerDelegate not bound + # Fixed in XAMCORE_4_0 !unknown-native-enum! SKCloudServiceAuthorizationStatus bound !unknown-native-enum! SKCloudServiceCapability bound diff --git a/tests/xtro-sharpie/macOS-StoreKit.todo b/tests/xtro-sharpie/macOS-StoreKit.todo deleted file mode 100644 index a01a131b50..0000000000 --- a/tests/xtro-sharpie/macOS-StoreKit.todo +++ /dev/null @@ -1,14 +0,0 @@ -!deprecated-attribute-missing! SKDownload::contentLength missing a [Deprecated] attribute -!deprecated-attribute-missing! SKProduct::downloadable missing a [Deprecated] attribute -!missing-protocol! SKCloudServiceSetupViewControllerDelegate not bound -!missing-protocol! SKPaymentQueueDelegate not bound -!missing-protocol! SKStoreProductViewControllerDelegate not bound -!missing-protocol-member! SKPaymentTransactionObserver::paymentQueueDidChangeStorefront: not found -!missing-selector! SKDownload::expectedContentLength not bound -!missing-selector! SKPaymentQueue::delegate not bound -!missing-selector! SKPaymentQueue::setDelegate: not bound -!missing-selector! SKPaymentQueue::storefront not bound -!missing-selector! SKProduct::isDownloadable not bound -!missing-selector! SKStorefront::countryCode not bound -!missing-selector! SKStorefront::identifier not bound -!missing-type! SKStorefront not bound diff --git a/tests/xtro-sharpie/tvOS-StoreKit.todo b/tests/xtro-sharpie/tvOS-StoreKit.todo deleted file mode 100644 index 9136b6966f..0000000000 --- a/tests/xtro-sharpie/tvOS-StoreKit.todo +++ /dev/null @@ -1,10 +0,0 @@ -!deprecated-attribute-missing! SKDownload::contentLength missing a [Deprecated] attribute -!missing-protocol! SKPaymentQueueDelegate not bound -!missing-protocol-member! SKPaymentTransactionObserver::paymentQueueDidChangeStorefront: not found -!missing-selector! SKDownload::expectedContentLength not bound -!missing-selector! SKPaymentQueue::delegate not bound -!missing-selector! SKPaymentQueue::setDelegate: not bound -!missing-selector! SKPaymentQueue::storefront not bound -!missing-selector! SKStorefront::countryCode not bound -!missing-selector! SKStorefront::identifier not bound -!missing-type! SKStorefront not bound