forked from dotnet/macios
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstorekit.cs
More file actions
1435 lines (1169 loc) · 42.8 KB
/
Copy pathstorekit.cs
File metadata and controls
1435 lines (1169 loc) · 42.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
//
// StoreKit.cs: This file describes the API that the generator will
// produce for StoreKit
//
// Authors:
// Miguel de Icaza
//
// Copyright 2009, Novell, Inc.
// Copyright 2012 Xamarin Inc.
// Copyright 2020 Microsoft Corp.
//
using ObjCRuntime;
using Foundation;
using CoreFoundation;
using CoreGraphics;
using StoreKit;
#if MONOMAC
using AppKit;
using UIViewController = AppKit.NSViewController;
using UIWindowScene = Foundation.NSObject;
#else
using UIKit;
#endif
#if WATCH
using UIViewController = Foundation.NSObject;
#endif
using System;
#if !NET
using NativeHandle = System.IntPtr;
#endif
#nullable enable
namespace StoreKit {
[ErrorDomain ("SKANErrorDomain")]
[NoWatch, NoTV, NoMac, iOS (15, 4), NoMacCatalyst]
[Native]
public enum SKANError : long {
ImpressionMissingRequiredValue = 0,
Unsupported = 1,
AdNetworkIdMissing = 2,
MismatchedSourceAppId = 3,
ImpressionNotFound = 4,
InvalidCampaignId = 5,
InvalidConversionValue = 6,
InvalidSourceAppId = 7,
InvalidAdvertisedAppId = 8,
InvalidVersion = 9,
Unknown = 10,
ImpressionTooShort = 11,
}
[Deprecated (PlatformName.iOS, 16, 0)]
[Deprecated (PlatformName.MacOSX, 13, 0)]
[Deprecated (PlatformName.TvOS, 16, 0)]
[Deprecated (PlatformName.WatchOS, 9, 0)]
[Watch (6, 2)]
[MacCatalyst (13, 1)]
[Deprecated (PlatformName.MacCatalyst, 16, 0)]
[BaseType (typeof (NSObject))]
partial interface SKDownload {
[iOS (12, 0)]
[TV (12, 0)]
[MacCatalyst (13, 1)]
[Export ("state")]
SKDownloadState State { get; }
#if MONOMAC
[NoiOS][NoTV][NoWatch][NoMacCatalyst]
[Obsolete ("Use 'State' instead.")]
[Wrap ("State", IsVirtual = true)]
SKDownloadState DownloadState { get; }
[NoiOS][NoTV][NoWatch][NoMacCatalyst]
[Deprecated (PlatformName.MacOSX, 10,15, message: "Use 'ExpectedContentLength' instead.")]
[Export ("contentLength", ArgumentSemantic.Copy)]
NSNumber ContentLength { get; }
#else
[NoMac]
[NoWatch]
[Deprecated (PlatformName.iOS, 12, 0, message: "Use 'State' instead.")]
[MacCatalyst (13, 1)]
[Deprecated (PlatformName.MacCatalyst, 13, 1, message: "Use 'State' instead.")]
[Export ("downloadState")]
SKDownloadState DownloadState { get; }
[NoMac]
[NoWatch]
[Deprecated (PlatformName.iOS, 13, 0, message: "Use 'ExpectedContentLength' instead.")]
[MacCatalyst (13, 1)]
[Deprecated (PlatformName.MacCatalyst, 13, 1, message: "Use 'ExpectedContentLength' instead.")]
[Export ("contentLength")]
long ContentLength { get; }
#endif
[TV (13, 0), iOS (13, 0)]
[MacCatalyst (13, 1)]
[Export ("expectedContentLength")]
long ExpectedContentLength { get; }
[Export ("contentIdentifier")]
string ContentIdentifier { get; }
[NullAllowed]
[Export ("contentURL", ArgumentSemantic.Copy)]
NSUrl ContentUrl { get; }
[Export ("contentVersion", ArgumentSemantic.Copy)]
string ContentVersion { get; }
[NullAllowed]
[Export ("error", ArgumentSemantic.Copy)]
NSError Error { get; }
[Export ("progress")]
float Progress { get; } /* float, not CGFloat */
[Export ("timeRemaining")]
double TimeRemaining { get; }
[NoWatch]
[NoTV]
[NoiOS]
[MacCatalyst (13, 1)]
[return: NullAllowed]
[Export ("contentURLForProductID:")]
[Static]
NSUrl GetContentUrlForProduct (string productId);
[NoWatch]
[NoTV]
[NoiOS]
[MacCatalyst (13, 1)]
[Export ("deleteContentForProductID:")]
[Static]
void DeleteContentForProduct (string productId);
[MacCatalyst (13, 1)]
[Field ("SKDownloadTimeRemainingUnknown")]
double TimeRemainingUnknown { get; }
[MacCatalyst (13, 1)]
[Export ("transaction")]
SKPaymentTransaction Transaction { get; }
}
[Watch (6, 2)]
[MacCatalyst (13, 1)]
[BaseType (typeof (NSObject))]
#if NET
[DisableDefaultCtor]
#endif
partial interface SKPayment : NSMutableCopying {
[Static]
[Export ("paymentWithProduct:")]
SKPayment CreateFrom (SKProduct product);
[NoMac]
[NoWatch]
[Static]
[Export ("paymentWithProductIdentifier:")]
[Deprecated (PlatformName.iOS, 5, 0, message: "Use 'FromProduct (SKProduct)'' after fetching the list of available products from 'SKProductRequest' instead.")]
[Deprecated (PlatformName.TvOS, 9, 0, message: "Use 'FromProduct (SKProduct)'' after fetching the list of available products from 'SKProductRequest' instead.")]
[MacCatalyst (13, 1)]
[Deprecated (PlatformName.MacCatalyst, 13, 1, message: "Use 'FromProduct (SKProduct)'' after fetching the list of available products from 'SKProductRequest' instead.")]
SKPayment CreateFrom (string identifier);
[Export ("productIdentifier", ArgumentSemantic.Copy)]
string ProductIdentifier { get; }
[Export ("requestData", ArgumentSemantic.Copy)]
[NullAllowed]
NSData RequestData { get; [NotImplemented ("Not available on SKPayment, only available on SKMutablePayment")] set; }
[Export ("quantity")]
nint Quantity { get; }
[MacCatalyst (13, 1)]
[NullAllowed]
[Export ("applicationUsername", ArgumentSemantic.Copy)]
string ApplicationUsername { get; }
[MacCatalyst (13, 1)]
[Export ("simulatesAskToBuyInSandbox")]
bool SimulatesAskToBuyInSandbox { get; [NotImplemented ("Not available on SKPayment, only available on SKMutablePayment")] set; }
[iOS (12, 2)]
[TV (12, 2)]
[MacCatalyst (13, 1)]
[NullAllowed, Export ("paymentDiscount", ArgumentSemantic.Copy)]
SKPaymentDiscount PaymentDiscount { get; [NotImplemented ("Not available on SKPayment, only available on SKMutablePayment")] set; }
}
[Watch (6, 2)]
[MacCatalyst (13, 1)]
[BaseType (typeof (SKPayment))]
#if NET
[DisableDefaultCtor]
#endif
interface SKMutablePayment {
[Static]
[Export ("paymentWithProduct:")]
SKMutablePayment PaymentWithProduct (SKProduct product);
[NoWatch]
[Static]
[Export ("paymentWithProductIdentifier:")]
[Deprecated (PlatformName.iOS, 5, 0, message: "Use 'PaymentWithProduct (SKProduct)' after fetching the list of available products from 'SKProductRequest' instead.")]
[MacCatalyst (13, 1)]
[Deprecated (PlatformName.MacCatalyst, 13, 1, message: "Use 'PaymentWithProduct (SKProduct)' after fetching the list of available products from 'SKProductRequest' instead.")]
SKMutablePayment PaymentWithProduct (string identifier);
[Export ("productIdentifier", ArgumentSemantic.Copy)]
[New]
string ProductIdentifier { get; set; }
[Export ("quantity")]
[New]
nint Quantity { get; set; }
[NullAllowed]
[Export ("requestData", ArgumentSemantic.Copy)]
[Override]
NSData RequestData { get; set; }
[MacCatalyst (13, 1)]
[NullAllowed] // by default this property is null
[Export ("applicationUsername", ArgumentSemantic.Copy)]
[New]
string ApplicationUsername { get; set; }
[MacCatalyst (13, 1)]
[Export ("simulatesAskToBuyInSandbox")]
bool SimulatesAskToBuyInSandbox { get; set; }
[iOS (12, 2)]
[TV (12, 2)]
[MacCatalyst (13, 1)]
[NullAllowed, Export ("paymentDiscount", ArgumentSemantic.Copy)]
SKPaymentDiscount PaymentDiscount { get; set; }
}
[Watch (6, 2)]
[MacCatalyst (13, 1)]
[BaseType (typeof (NSObject))]
interface SKPaymentQueue {
[Export ("defaultQueue")]
[Static]
SKPaymentQueue DefaultQueue { get; }
[Export ("canMakePayments")]
[Static]
bool CanMakePayments { get; }
[Export ("addPayment:")]
void AddPayment (SKPayment payment);
[Export ("restoreCompletedTransactions")]
void RestoreCompletedTransactions ();
[MacCatalyst (13, 1)]
[Export ("restoreCompletedTransactionsWithApplicationUsername:")]
void RestoreCompletedTransactions ([NullAllowed] string username);
[Export ("finishTransaction:")]
void FinishTransaction (SKPaymentTransaction transaction);
[Export ("addTransactionObserver:")]
void AddTransactionObserver ([Protocolize] SKPaymentTransactionObserver observer);
[Export ("removeTransactionObserver:")]
void RemoveTransactionObserver ([Protocolize] SKPaymentTransactionObserver observer);
[Export ("transactions")]
SKPaymentTransaction [] Transactions { get; }
//
// iOS 6.0
//
[Deprecated (PlatformName.iOS, 16, 0)]
[Deprecated (PlatformName.MacOSX, 13, 0)]
[Deprecated (PlatformName.TvOS, 16, 0)]
[Deprecated (PlatformName.WatchOS, 9, 0)]
[Deprecated (PlatformName.MacCatalyst, 16, 0)]
[Export ("startDownloads:")]
void StartDownloads (SKDownload [] downloads);
[Deprecated (PlatformName.iOS, 16, 0)]
[Deprecated (PlatformName.MacOSX, 13, 0)]
[Deprecated (PlatformName.TvOS, 16, 0)]
[Deprecated (PlatformName.WatchOS, 9, 0)]
[Deprecated (PlatformName.MacCatalyst, 16, 0)]
[Export ("pauseDownloads:")]
void PauseDownloads (SKDownload [] downloads);
[Deprecated (PlatformName.iOS, 16, 0)]
[Deprecated (PlatformName.MacOSX, 13, 0)]
[Deprecated (PlatformName.TvOS, 16, 0)]
[Deprecated (PlatformName.WatchOS, 9, 0)]
[Deprecated (PlatformName.MacCatalyst, 16, 0)]
[Export ("resumeDownloads:")]
void ResumeDownloads (SKDownload [] downloads);
[Deprecated (PlatformName.iOS, 16, 0)]
[Deprecated (PlatformName.MacOSX, 13, 0)]
[Deprecated (PlatformName.TvOS, 16, 0)]
[Deprecated (PlatformName.WatchOS, 9, 0)]
[Deprecated (PlatformName.MacCatalyst, 16, 0)]
[Export ("cancelDownloads:")]
void CancelDownloads (SKDownload [] downloads);
[iOS (13, 0)]
[MacCatalyst (13, 1)]
[Wrap ("WeakDelegate")]
[NullAllowed]
ISKPaymentQueueDelegate Delegate { get; set; }
[iOS (13, 0)]
[TV (13, 0)]
[MacCatalyst (13, 1)]
[NullAllowed, Export ("delegate", ArgumentSemantic.Weak)]
NSObject WeakDelegate { get; set; }
[iOS (13, 0)]
[TV (13, 0)]
[MacCatalyst (13, 1)]
[NullAllowed, Export ("storefront")]
SKStorefront Storefront { get; }
[NoWatch, NoTV, NoMac, iOS (13, 4)]
[NoMacCatalyst]
[Export ("showPriceConsentIfNeeded")]
void ShowPriceConsentIfNeeded ();
[NoWatch, NoTV, NoMac, iOS (14, 0)]
[NoMacCatalyst]
[Export ("presentCodeRedemptionSheet")]
void PresentCodeRedemptionSheet ();
[Watch (7, 0), TV (14, 0), Mac (11, 0), iOS (14, 0)]
[MacCatalyst (14, 0)]
[Export ("transactionObservers")]
ISKPaymentTransactionObserver [] TransactionObservers { get; }
}
[Watch (6, 2)]
[MacCatalyst (13, 1)]
[BaseType (typeof (NSObject))]
interface SKProduct {
[Export ("localizedDescription")]
string LocalizedDescription { get; }
[Export ("localizedTitle")]
string LocalizedTitle { get; }
[Export ("price")]
NSDecimalNumber Price { get; }
[Export ("priceLocale")]
NSLocale PriceLocale { get; }
[Export ("productIdentifier")]
string ProductIdentifier { get; }
#if MONOMAC
[NoWatch][NoiOS][NoTV][NoMacCatalyst]
[Deprecated (PlatformName.MacOSX, 10,15, message: "Use 'IsDownloadable' instead.")]
[Export ("downloadable")]
bool Downloadable { get; }
#elif !NET
[NoMac]
[Obsolete ("Use 'IsDownloadable' instead.")]
bool Downloadable {
[Wrap ("IsDownloadable")]
get;
}
#endif
[MacCatalyst (13, 1)]
[Export ("isDownloadable")]
bool IsDownloadable { get; }
[NoiOS]
[NoWatch]
#if NET
[NoTV]
#else
[Deprecated (PlatformName.TvOS, 9, 0, message: "Use 'DownloadContentLengths' instead.")]
#endif
[Deprecated (PlatformName.MacOSX, 10, 14, message: "Use 'DownloadContentLengths' instead.")]
[NoMacCatalyst]
[Export ("contentLengths")]
NSNumber [] ContentLengths { get; }
[MacCatalyst (13, 1)]
[Export ("downloadContentLengths")]
NSNumber [] DownloadContentLengths { get; }
[iOS (13, 0)]
[TV (13, 0)]
[Deprecated (PlatformName.MacOSX, 10, 14, message: "Use 'DownloadContentVersion' instead.")]
[MacCatalyst (13, 1)]
[Export ("contentVersion")]
string ContentVersion { get; }
[MacCatalyst (13, 1)]
[Export ("downloadContentVersion")]
string DownloadContentVersion { get; }
[iOS (11, 2), TV (11, 2)]
[MacCatalyst (13, 1)]
[NullAllowed, Export ("subscriptionPeriod")]
SKProductSubscriptionPeriod SubscriptionPeriod { get; }
[iOS (11, 2), TV (11, 2)]
[MacCatalyst (13, 1)]
[NullAllowed, Export ("introductoryPrice")]
SKProductDiscount IntroductoryPrice { get; }
[iOS (12, 0), TV (12, 0)]
[MacCatalyst (13, 1)]
[NullAllowed, Export ("subscriptionGroupIdentifier")]
string SubscriptionGroupIdentifier { get; }
[iOS (12, 2)]
[TV (12, 2)]
[MacCatalyst (13, 1)]
[Export ("discounts")]
SKProductDiscount [] Discounts { get; }
[Watch (7, 0), TV (14, 0), Mac (11, 0), iOS (14, 0)]
[MacCatalyst (14, 0)]
[Export ("isFamilyShareable")]
bool IsFamilyShareable { get; }
}
interface ISKPaymentTransactionObserver { }
[Watch (6, 2)]
[MacCatalyst (13, 1)]
[BaseType (typeof (NSObject))]
[Model]
[Protocol]
interface SKPaymentTransactionObserver {
[Export ("paymentQueue:updatedTransactions:")]
[Abstract]
void UpdatedTransactions (SKPaymentQueue queue, SKPaymentTransaction [] transactions);
[Export ("paymentQueue:removedTransactions:")]
void RemovedTransactions (SKPaymentQueue queue, SKPaymentTransaction [] transactions);
[Export ("paymentQueue:restoreCompletedTransactionsFailedWithError:")]
void RestoreCompletedTransactionsFailedWithError (SKPaymentQueue queue, NSError error);
[Export ("paymentQueueRestoreCompletedTransactionsFinished:")]
void RestoreCompletedTransactionsFinished (SKPaymentQueue queue);
[Deprecated (PlatformName.iOS, 16, 0)]
[Deprecated (PlatformName.MacOSX, 13, 0)]
[Deprecated (PlatformName.TvOS, 16, 0)]
[Deprecated (PlatformName.WatchOS, 9, 0)]
[Deprecated (PlatformName.MacCatalyst, 16, 0)]
[Export ("paymentQueue:updatedDownloads:")]
void UpdatedDownloads (SKPaymentQueue queue, SKDownload [] downloads);
[Mac (11, 0)]
[NoWatch]
[MacCatalyst (13, 1)]
[Export ("paymentQueue:shouldAddStorePayment:forProduct:")]
bool ShouldAddStorePayment (SKPaymentQueue queue, SKPayment payment, SKProduct product);
[iOS (13, 0)]
[TV (13, 0)]
[MacCatalyst (13, 1)]
[Export ("paymentQueueDidChangeStorefront:")]
void DidChangeStorefront (SKPaymentQueue queue);
[Watch (7, 0), TV (14, 0), Mac (11, 0), iOS (14, 0)]
[MacCatalyst (14, 0)]
[Export ("paymentQueue:didRevokeEntitlementsForProductIdentifiers:")]
void DidRevokeEntitlements (SKPaymentQueue queue, string [] productIdentifiers);
}
[Watch (6, 2)]
[MacCatalyst (13, 1)]
[BaseType (typeof (NSObject))]
interface SKPaymentTransaction {
[NullAllowed]
[Export ("error")]
NSError Error { get; }
[NullAllowed]
[Export ("originalTransaction")]
SKPaymentTransaction OriginalTransaction { get; }
[Export ("payment")]
SKPayment Payment { get; }
[NullAllowed]
[Export ("transactionDate")]
NSDate TransactionDate { get; }
[NullAllowed]
[Export ("transactionIdentifier")]
string TransactionIdentifier { get; }
[NoMac]
[NoWatch]
[Deprecated (PlatformName.iOS, 7, 0, message: "Use 'NSBundle.AppStoreReceiptUrl' instead.")]
[Deprecated (PlatformName.TvOS, 9, 0, message: "Use 'NSBundle.AppStoreReceiptUrl' instead.")]
[MacCatalyst (13, 1)]
[Deprecated (PlatformName.MacCatalyst, 13, 1, message: "Use 'NSBundle.AppStoreReceiptUrl' instead.")]
[NullAllowed]
[Export ("transactionReceipt")]
NSData TransactionReceipt { get; }
[Export ("transactionState")]
SKPaymentTransactionState TransactionState { get; }
[Deprecated (PlatformName.iOS, 16, 0)]
[Deprecated (PlatformName.MacOSX, 13, 0)]
[Deprecated (PlatformName.TvOS, 16, 0)]
[Deprecated (PlatformName.WatchOS, 9, 0)]
[Deprecated (PlatformName.MacCatalyst, 16, 0)]
[Export ("downloads")]
SKDownload [] Downloads { get; }
}
[Watch (6, 2)]
[MacCatalyst (13, 1)]
[BaseType (typeof (NSObject), Delegates = new string [] { "WeakDelegate" }, Events = new Type [] { typeof (SKRequestDelegate) })]
interface SKRequest {
[Export ("delegate", ArgumentSemantic.Weak)]
[NullAllowed]
NSObject WeakDelegate { get; set; }
[Wrap ("WeakDelegate")]
[Protocolize]
SKRequestDelegate Delegate { get; set; }
[Export ("cancel")]
void Cancel ();
[Export ("start")]
void Start ();
}
[Watch (6, 2)]
[MacCatalyst (13, 1)]
[BaseType (typeof (NSObject))]
[Model]
[Protocol]
interface SKRequestDelegate {
[Export ("requestDidFinish:")]
void RequestFinished (SKRequest request);
[Export ("request:didFailWithError:"), EventArgs ("SKRequestError")]
void RequestFailed (SKRequest request, NSError error);
}
[Watch (6, 2)]
[MacCatalyst (13, 1)]
[BaseType (typeof (SKRequest))]
interface SKReceiptRefreshRequest {
[Export ("initWithReceiptProperties:")]
NativeHandle Constructor ([NullAllowed] NSDictionary properties);
[Wrap ("this (receiptProperties.GetDictionary ())")]
NativeHandle Constructor ([NullAllowed] SKReceiptProperties receiptProperties);
[NullAllowed]
[Export ("receiptProperties")]
NSDictionary WeakReceiptProperties { get; }
[NullAllowed]
[Wrap ("WeakReceiptProperties")]
SKReceiptProperties ReceiptProperties { get; }
}
[Watch (6, 2)]
[MacCatalyst (13, 1)]
[Static, Internal]
interface _SKReceiptProperty {
[Field ("SKReceiptPropertyIsExpired"), Internal]
NSString IsExpired { get; }
[Field ("SKReceiptPropertyIsRevoked"), Internal]
NSString IsRevoked { get; }
[Field ("SKReceiptPropertyIsVolumePurchase"), Internal]
NSString IsVolumePurchase { get; }
}
[Watch (6, 2)]
[MacCatalyst (13, 1)]
[BaseType (typeof (SKRequest), Delegates = new string [] { "WeakDelegate" }, Events = new Type [] { typeof (SKProductsRequestDelegate) })]
interface SKProductsRequest {
[Export ("initWithProductIdentifiers:")]
NativeHandle Constructor (NSSet productIdentifiersStringSet);
[Export ("delegate", ArgumentSemantic.Weak)]
[NullAllowed]
[New]
NSObject WeakDelegate { get; set; }
[Wrap ("WeakDelegate")]
[New]
[Protocolize]
SKProductsRequestDelegate Delegate { get; set; }
}
[Watch (6, 2)]
[MacCatalyst (13, 1)]
[BaseType (typeof (NSObject))]
interface SKProductsResponse {
[Export ("products")]
SKProduct [] Products { get; }
[Export ("invalidProductIdentifiers")]
string [] InvalidProducts { get; }
}
[Watch (6, 2)]
[MacCatalyst (13, 1)]
[BaseType (typeof (SKRequestDelegate))]
[Model]
[Protocol]
interface SKProductsRequestDelegate {
[Export ("productsRequest:didReceiveResponse:")]
[Abstract]
[EventArgs ("SKProductsRequestResponse")]
void ReceivedResponse (SKProductsRequest request, SKProductsResponse response);
}
[Mac (11, 0), NoTV, NoWatch]
[MacCatalyst (13, 1)]
[BaseType (typeof (UIViewController),
Delegates = new string [] { "WeakDelegate" },
Events = new Type [] { typeof (SKStoreProductViewControllerDelegate) })]
interface SKStoreProductViewController {
#if !NET
// SKStoreProductViewController is an OS View Controller which can't be customized
[Export ("initWithNibName:bundle:")]
[PostGet ("NibBundle")]
NativeHandle Constructor ([NullAllowed] string nibName, [NullAllowed] NSBundle bundle);
#endif
[Export ("delegate", ArgumentSemantic.Assign), NullAllowed]
NSObject WeakDelegate { get; set; }
[Wrap ("WeakDelegate")]
[Protocolize]
SKStoreProductViewControllerDelegate Delegate { get; set; }
[Export ("loadProductWithParameters:completionBlock:")]
[Internal]
[Async]
void LoadProduct (NSDictionary parameters, [NullAllowed] Action<bool, NSError> callback);
[Wrap ("LoadProduct (parameters.GetDictionary ()!, callback)")]
[Async]
void LoadProduct (StoreProductParameters parameters, [NullAllowed] Action<bool, NSError> callback);
[Async]
[NoMac, iOS (16, 0)]
[MacCatalyst (16, 0)]
[Export ("loadProductWithParameters:impression:completionBlock:")]
void LoadProduct (NSDictionary parameters, SKAdImpression impression, [NullAllowed] Action<bool, NSError> callback);
[Async]
[NoMac, iOS (16, 0)]
[MacCatalyst (16, 0)]
[Wrap ("LoadProduct (parameters.GetDictionary ()!, impression, callback)")]
void LoadProduct (StoreProductParameters parameters, SKAdImpression impression, [NullAllowed] Action<bool, NSError> callback);
}
[Mac (11, 0), NoTV, NoWatch]
[MacCatalyst (13, 1)]
[BaseType (typeof (NSObject))]
[Model]
[Protocol]
interface SKStoreProductViewControllerDelegate {
[Export ("productViewControllerDidFinish:"), EventArgs ("SKStoreProductViewController")]
void Finished (SKStoreProductViewController controller);
}
[NoWatch]
[Mac (11, 0)]
[MacCatalyst (13, 1)]
[StrongDictionary ("SKStoreProductParameterKey")]
interface StoreProductParameters {
[MacCatalyst (13, 1)]
[Export ("ProductIdentifier")]
string ProductIdentifier { get; set; }
[MacCatalyst (13, 1)]
[Export ("ProviderToken")]
string ProviderToken { get; set; }
[iOS (11, 3), TV (11, 3), NoMac]
[MacCatalyst (13, 1)]
[Export ("AdNetworkAttributionSignature")]
string AdNetworkAttributionSignature { get; set; }
[iOS (11, 3), TV (11, 3), NoMac]
[MacCatalyst (13, 1)]
[Export ("AdNetworkCampaignIdentifier")]
uint AdNetworkCampaignIdentifier { get; set; }
[iOS (11, 3), TV (11, 3), NoMac]
[MacCatalyst (13, 1)]
[Export ("AdNetworkIdentifier")]
string AdNetworkIdentifier { get; set; }
[iOS (11, 3), TV (11, 3), NoMac]
[MacCatalyst (13, 1)]
[Export ("AdNetworkNonce")]
NSUuid AdNetworkNonce { get; set; }
[iOS (11, 3), TV (11, 3), NoMac]
[MacCatalyst (13, 1)]
[Export ("AdNetworkTimestamp")]
uint AdNetworkTimestamp { get; set; }
[NoWatch, NoMac, TV (14, 0), iOS (14, 0)]
[MacCatalyst (14, 0)]
[Export ("AdNetworkSourceAppStoreIdentifier")]
string AdNetworkSourceAppStoreIdentifier { get; set; }
[NoWatch, NoMac, TV (14, 0), iOS (14, 0)]
[MacCatalyst (14, 0)]
[Export ("AdNetworkVersion")]
string AdNetworkVersion { get; set; }
}
[NoWatch]
[Mac (11, 0)]
[MacCatalyst (13, 1)]
[Static]
interface SKStoreProductParameterKey {
[Field ("SKStoreProductParameterITunesItemIdentifier")]
NSString ITunesItemIdentifier { get; }
[MacCatalyst (13, 1)]
[Field ("SKStoreProductParameterProductIdentifier")]
NSString ProductIdentifier { get; }
[MacCatalyst (13, 1)]
[Field ("SKStoreProductParameterAffiliateToken")]
NSString AffiliateToken { get; }
[MacCatalyst (13, 1)]
[Field ("SKStoreProductParameterCampaignToken")]
NSString CampaignToken { get; }
[MacCatalyst (13, 1)]
[Field ("SKStoreProductParameterProviderToken")]
NSString ProviderToken { get; }
[MacCatalyst (13, 1)]
[Field ("SKStoreProductParameterAdvertisingPartnerToken")]
NSString AdvertisingPartnerToken { get; }
[iOS (11, 3), TV (11, 3), NoMac]
[MacCatalyst (13, 1)]
[Field ("SKStoreProductParameterAdNetworkAttributionSignature")]
NSString AdNetworkAttributionSignature { get; }
[iOS (11, 3), TV (11, 3), NoMac]
[MacCatalyst (13, 1)]
[Field ("SKStoreProductParameterAdNetworkCampaignIdentifier")]
NSString AdNetworkCampaignIdentifier { get; }
[NoMac, iOS (16, 0), MacCatalyst (16, 0), NoWatch, TV (17, 0)]
[Field ("SKStoreProductParameterAdNetworkSourceIdentifier")]
NSString AdNetworkSourceIdentifier { get; }
[iOS (11, 3), TV (11, 3), NoMac]
[MacCatalyst (13, 1)]
[Field ("SKStoreProductParameterAdNetworkIdentifier")]
NSString AdNetworkIdentifier { get; }
[iOS (11, 3), TV (11, 3), NoMac]
[MacCatalyst (13, 1)]
[Field ("SKStoreProductParameterAdNetworkNonce")]
NSString AdNetworkNonce { get; }
[iOS (11, 3), TV (11, 3), NoMac]
[MacCatalyst (13, 1)]
[Field ("SKStoreProductParameterAdNetworkTimestamp")]
NSString AdNetworkTimestamp { get; }
[NoWatch, NoMac, TV (14, 0), iOS (14, 0)]
[MacCatalyst (14, 0)]
[Field ("SKStoreProductParameterAdNetworkSourceAppStoreIdentifier")]
NSString AdNetworkSourceAppStoreIdentifier { get; }
[NoWatch, NoMac, TV (14, 0), iOS (14, 0)]
[MacCatalyst (14, 0)]
[Field ("SKStoreProductParameterAdNetworkVersion")]
NSString AdNetworkVersion { get; }
[Mac (12, 0), iOS (15, 0), TV (15, 0), MacCatalyst (15, 0)]
[Field ("SKStoreProductParameterCustomProductPageIdentifier")]
NSString CustomProductPageIdentifier { get; }
}
[NoMac]
[NoWatch]
[NoTV] // __TVOS_PROHIBITED
[MacCatalyst (13, 1)]
[BaseType (typeof (UIViewController))]
interface SKCloudServiceSetupViewController {
[NullAllowed, Export ("delegate", ArgumentSemantic.Weak)]
ISKCloudServiceSetupViewControllerDelegate Delegate { get; set; }
[Async]
[Export ("loadWithOptions:completionHandler:")]
void Load (NSDictionary options, [NullAllowed] Action<bool, NSError> completionHandler);
[Async]
[Wrap ("Load (options.GetDictionary ()!, completionHandler)")]
void Load (SKCloudServiceSetupOptions options, Action<bool, NSError> completionHandler);
}
[NoMac]
[MacCatalyst (13, 1)]
interface ISKCloudServiceSetupViewControllerDelegate { }
[NoMac]
[NoWatch]
[NoTV] // __TVOS_PROHIBITED on the only member + SKCloudServiceSetupViewController is not in tvOS
[MacCatalyst (13, 1)]
[Protocol, Model]
[BaseType (typeof (NSObject))]
interface SKCloudServiceSetupViewControllerDelegate {
[Export ("cloudServiceSetupViewControllerDidDismiss:")]
void DidDismiss (SKCloudServiceSetupViewController cloudServiceSetupViewController);
}
[NoMac]
[NoWatch, NoTV]
[MacCatalyst (13, 1)]
[StrongDictionary ("SKCloudServiceSetupOptionsKeys")]
interface SKCloudServiceSetupOptions {
// Headers comment: Action for setup entry point (of type SKCloudServiceSetupAction).
// FIXME: Once https://bugzilla.xamarin.com/show_bug.cgi?id=57870 is fixed we should have a wrapper on a new property
// `SKCloudServiceSetupAction Action { get; set; }` and avoid manual code.
[Internal]
[Export ("ActionKey")]
NSString _Action { get; set; }
// Headers comment: Identifier of the iTunes Store item the user is trying to access which requires cloud service setup (NSNumber).
nint ITunesItemIdentifier { get; set; }
[MacCatalyst (13, 1)]
string AffiliateToken { get; set; }
[MacCatalyst (13, 1)]
string CampaignToken { get; set; }
[MacCatalyst (13, 1)]
string MessageIdentifier { get; set; }
}
[NoMac]
[NoWatch, NoTV]
[MacCatalyst (13, 1)]
[Internal, Static]
interface SKCloudServiceSetupOptionsKeys {
[Field ("SKCloudServiceSetupOptionsActionKey")]
NSString ActionKey { get; }
[Field ("SKCloudServiceSetupOptionsITunesItemIdentifierKey")]
NSString ITunesItemIdentifierKey { get; }
[MacCatalyst (13, 1)]
[Field ("SKCloudServiceSetupOptionsAffiliateTokenKey")]
NSString AffiliateTokenKey { get; }
[MacCatalyst (13, 1)]
[Field ("SKCloudServiceSetupOptionsCampaignTokenKey")]
NSString CampaignTokenKey { get; }
[MacCatalyst (13, 1)]
[Field ("SKCloudServiceSetupOptionsMessageIdentifierKey")]
NSString MessageIdentifierKey { get; }
}
[NoMac]
[NoWatch, NoTV]
[MacCatalyst (13, 1)]
enum SKCloudServiceSetupAction {
[Field ("SKCloudServiceSetupActionSubscribe")]
Subscribe,
}
[NoMac]
[NoWatch]
[MacCatalyst (13, 1)]
enum SKCloudServiceSetupMessageIdentifier {
[Field ("SKCloudServiceSetupMessageIdentifierJoin")]
Join,
[Field ("SKCloudServiceSetupMessageIdentifierConnect")]
Connect,
[Field ("SKCloudServiceSetupMessageIdentifierAddMusic")]
AddMusic,
[Field ("SKCloudServiceSetupMessageIdentifierPlayMusic")]
PlayMusic,
}
[Mac (11, 0), Watch (7, 0)]
[MacCatalyst (13, 1)]
[BaseType (typeof (NSObject))]
interface SKCloudServiceController {
[Static]
[Export ("authorizationStatus")]
SKCloudServiceAuthorizationStatus AuthorizationStatus { get; }
[Static]
[Async]
[Export ("requestAuthorization:")]
void RequestAuthorization (Action<SKCloudServiceAuthorizationStatus> handler);
[Async]
[Export ("requestStorefrontIdentifierWithCompletionHandler:")]
void RequestStorefrontIdentifier (Action<NSString, NSError> completionHandler);
[MacCatalyst (13, 1)]
[Async]
[Export ("requestStorefrontCountryCodeWithCompletionHandler:")]
void RequestStorefrontCountryCode (Action<NSString, NSError> completionHandler);
[Async]
[Export ("requestCapabilitiesWithCompletionHandler:")]
void RequestCapabilities (Action<SKCloudServiceCapability, NSError> completionHandler);
[Deprecated (PlatformName.iOS, 11, 0, message: "Use 'RequestUserToken' instead.")]
[Deprecated (PlatformName.TvOS, 11, 0, message: "Use 'RequestUserToken' instead.")]
[MacCatalyst (13, 1)]
[Deprecated (PlatformName.MacCatalyst, 13, 1, message: "Use 'RequestUserToken' instead.")]
[Async]
[Export ("requestPersonalizationTokenForClientToken:withCompletionHandler:")]
void RequestPersonalizationToken (string clientToken, Action<NSString, NSError> completionHandler);
[MacCatalyst (13, 1)]
[Async]
[Export ("requestUserTokenForDeveloperToken:completionHandler:")]
void RequestUserToken (string developerToken, Action<NSString, NSError> completionHandler);
[Notification]
[Field ("SKStorefrontIdentifierDidChangeNotification")]
NSString StorefrontIdentifierDidChangeNotification { get; }
[Notification]
[Field ("SKCloudServiceCapabilitiesDidChangeNotification")]
NSString CloudServiceCapabilitiesDidChangeNotification { get; }
[MacCatalyst (13, 1)]
[Notification]
[Field ("SKStorefrontCountryCodeDidChangeNotification")]
NSString StorefrontCountryCodeDidChangeNotification { get; }
}
[Introduced (PlatformName.MacCatalyst, 14, 0)]
[NoWatch, Mac (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);
}
[NoTV]
[NoWatch]
[MacCatalyst (13, 1)]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor] // Not specified but very likely