您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 

50 行
1.8 KiB

  1. #import <StoreKit/StoreKit.h>
  2. // Callback to Unity identifying the subject, JSON message body and optional app receipt.
  3. // Note that App Receipts are sent separately to the JSON body for performance reasons.
  4. typedef void (*UnityPurchasingCallback)(const char* subject, const char* payload, const char* receipt, const char* transactionId);
  5. @interface ProductDefinition : NSObject
  6. @property (nonatomic, strong) NSString *id;
  7. @property (nonatomic, strong) NSString *storeSpecificId;
  8. @property (nonatomic, strong) NSString *type;
  9. @end
  10. @interface ReceiptRefresher : NSObject <SKRequestDelegate>
  11. @property (nonatomic, strong) void (^callback)(BOOL);
  12. @end
  13. @interface UnityPurchasing : NSObject <SKProductsRequestDelegate, SKPaymentTransactionObserver> {
  14. UnityPurchasingCallback messageCallback;
  15. NSMutableDictionary* validProducts;
  16. NSSet* productIds;
  17. SKProductsRequest *request;
  18. NSMutableDictionary *pendingTransactions;
  19. NSMutableSet *finishedTransactions;
  20. // Dictionary that maps product IDs to the most recent transaction receipt (base 64 encoded).
  21. NSMutableDictionary<NSString *, NSString *> *transactionReceipts;
  22. }
  23. + (NSArray*) deserializeProductDefs:(NSString*)json;
  24. + (ProductDefinition*) deserializeProductDef:(NSString*)json;
  25. + (NSString*) serializeProductMetadata:(NSArray*)products;
  26. -(void) restorePurchases;
  27. -(NSString*) getAppReceipt;
  28. -(NSString*) getTransactionReceiptForProductId:(NSString *)productId;
  29. -(void) addTransactionObserver;
  30. @property (nonatomic, strong) ReceiptRefresher* receiptRefresher;
  31. @property (nonatomic, strong) SKReceiptRefreshRequest* refreshRequest;
  32. @property BOOL simulateAskToBuyEnabled;
  33. @property (nonatomic, copy, readwrite) NSString* applicationUsername;
  34. @property (nonatomic) BOOL interceptPromotionalPurchases;
  35. @end