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

[storekit] Update up to beta 4 #2379

Merged
merged 2 commits into from
Jul 31, 2017
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
8 changes: 8 additions & 0 deletions src/StoreKit/Enums.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,13 @@ public enum SKCloudServiceCapability : nuint {
MusicCatalogSubscriptionEligible = 1 << 1,
AddToCloudMusicLibrary = 1 << 8
}

[iOS (11,0)][TV (11,0)][NoMac]
[Native]
public enum SKProductStorePromotionVisibility : nint {
Default,
Show,
Hide,
}
#endif
}
69 changes: 69 additions & 0 deletions src/storekit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,10 @@ interface SKPaymentTransactionObserver {
[Since(6,0)]
[Export ("paymentQueue:updatedDownloads:")]
void UpdatedDownloads (SKPaymentQueue queue, SKDownload [] downloads);

[iOS (11,0)][TV (11,0)][NoMac]
[Export ("paymentQueue:shouldAddStorePayment:forProduct:")]
bool ShouldAddStorePayment (SKPaymentQueue queue, SKPayment payment, SKProduct product);
}

[BaseType (typeof (NSObject))]
Expand Down Expand Up @@ -414,6 +418,10 @@ interface SKStoreProductParameterKey
[Field ("SKStoreProductParameterITunesItemIdentifier")]
NSString ITunesItemIdentifier { get; }

[iOS (11,0)][TV (11,0)]
[Field ("SKStoreProductParameterProductIdentifier")]
NSString ProductIdentifier { get; }

[iOS (8,0)]
[Field ("SKStoreProductParameterAffiliateToken")]
NSString AffiliateToken { get; }
Expand Down Expand Up @@ -461,22 +469,39 @@ interface SKCloudServiceController {
[Export ("requestStorefrontIdentifierWithCompletionHandler:")]
void RequestStorefrontIdentifier (Action<NSString, NSError> completionHandler);

[iOS (11,0)][TV (11,0)]
[Async]
[Export ("requestStorefrontCountryCodeWithCompletionHandler:")]
void RequestStorefrontCountryCode (Action<NSString, NSError> completionHandler);

[Async]
[Export ("requestCapabilitiesWithCompletionHandler:")]
void RequestCapabilities (Action<SKCloudServiceCapability, NSError> completionHandler);

[iOS (10,3), TV (10,2)]
[Deprecated (PlatformName.iOS, 11,0, message: "Use 'RequestUserToken' instead.")]
[Deprecated (PlatformName.TvOS, 11,0, message: "Use 'RequestUserToken' instead.")]
[Async]
[Export ("requestPersonalizationTokenForClientToken:withCompletionHandler:")]
void RequestPersonalizationToken (string clientToken, Action<NSString, NSError> completionHandler);

[iOS (11,0)][TV (11,0)]
[Async]
[Export ("requestUserTokenForDeveloperToken:completionHandler:")]
void RequestUserToken (string developerToken, Action<NSString, NSError> completionHandler);

[Notification]
[Field ("SKStorefrontIdentifierDidChangeNotification")]
NSString StorefrontIdentifierDidChangeNotification { get; }

[Notification]
[Field ("SKCloudServiceCapabilitiesDidChangeNotification")]
NSString CloudServiceCapabilitiesDidChangeNotification { get; }

[iOS (11,0)][TV (11,0)]
[Notification]
[Field ("SKStorefrontCountryCodeDidChangeNotification")]
NSString StorefrontCountryCodeDidChangeNotification { get; }
}

[iOS (10,1)]
Expand Down Expand Up @@ -523,6 +548,9 @@ interface SKCloudServiceSetupOptions

[iOS (10,3)]
string CampaignToken { get; set; }

[iOS (11,0)]
string MessageIdentifier { get; set; }
}

[NoTV, iOS (10,1)]
Expand All @@ -542,6 +570,10 @@ interface SKCloudServiceSetupOptionsKeys
[iOS (10,3)]
[Field ("SKCloudServiceSetupOptionsCampaignTokenKey")]
NSString CampaignTokenKey { get; }

[iOS (11,0)]
[Field ("SKCloudServiceSetupOptionsMessageIdentifierKey")]
NSString MessageIdentifierKey { get; }
}

[NoTV, iOS (10,1)]
Expand All @@ -551,6 +583,18 @@ enum SKCloudServiceSetupAction
Subscribe,
}

[iOS (11,0)]
enum SKCloudServiceSetupMessageIdentifier {
[Field ("SKCloudServiceSetupMessageIdentifierJoin")]
Join,
[Field ("SKCloudServiceSetupMessageIdentifierConnect")]
Connect,
[Field ("SKCloudServiceSetupMessageIdentifierAddMusic")]
AddMusic,
[Field ("SKCloudServiceSetupMessageIdentifierPlayMusic")]
PlayMusic,
}

[iOS (10,3)]
[NoTV]
[BaseType (typeof (NSObject))]
Expand All @@ -561,5 +605,30 @@ interface SKStoreReviewController {
[Export ("requestReview")]
void RequestReview ();
}

[iOS (11,0)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor] // static Default property is the only documented way to get the controller
interface SKProductStorePromotionController {
[Static]
[Export ("defaultController")]
SKProductStorePromotionController Default { get; }

[Async]
[Export ("fetchStorePromotionVisibilityForProduct:completionHandler:")]
void FetchStorePromotionVisibility (SKProduct product, [NullAllowed] Action<SKProductStorePromotionVisibility, NSError> completionHandler);

[Async]
[Export ("updateStorePromotionVisibility:forProduct:completionHandler:")]
void Update (SKProductStorePromotionVisibility promotionVisibility, SKProduct product, [NullAllowed] Action<NSError> completionHandler);

[Async]
[Export ("fetchStorePromotionOrderWithCompletionHandler:")]
void FetchStorePromotionOrder ([NullAllowed] Action<SKProduct [], NSError> completionHandler);

[Async]
[Export ("updateStorePromotionOrder:completionHandler:")]
void Update (SKProduct[] storePromotionOrder, [NullAllowed] Action<NSError> completionHandler);
}
#endif
}
1 change: 1 addition & 0 deletions tests/xtro-sharpie/tvos.ignore
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,7 @@
!missing-field! SKCloudServiceSetupOptionsITunesItemIdentifierKey not bound
!missing-field! SKCloudServiceSetupOptionsAffiliateTokenKey not bound
!missing-field! SKCloudServiceSetupOptionsCampaignTokenKey not bound
!missing-field! SKCloudServiceSetupOptionsMessageIdentifierKey not bound
!missing-protocol! SKCloudServiceSetupViewControllerDelegate not bound


Expand Down