react-native-iap 12.8.2 → 12.8.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. package/android/build.gradle +1 -1
  2. package/ios/IapSerializationUtils.swift +12 -0
  3. package/ios/RNIapIos.swift +28 -31
  4. package/lib/commonjs/eventEmitter.js.map +1 -1
  5. package/lib/commonjs/hooks/index.js.map +1 -1
  6. package/lib/commonjs/hooks/useIAP.js.map +1 -1
  7. package/lib/commonjs/hooks/withIAPContext.js.map +1 -1
  8. package/lib/commonjs/iap.js.map +1 -1
  9. package/lib/commonjs/index.js.map +1 -1
  10. package/lib/commonjs/internal/enhancedFetch.js.map +1 -1
  11. package/lib/commonjs/internal/fillProductsWithAdditionalData.js.map +1 -1
  12. package/lib/commonjs/internal/index.js.map +1 -1
  13. package/lib/commonjs/internal/platform.js.map +1 -1
  14. package/lib/commonjs/modules/amazon.js.map +1 -1
  15. package/lib/commonjs/modules/android.js.map +1 -1
  16. package/lib/commonjs/modules/common.js.map +1 -1
  17. package/lib/commonjs/modules/index.js.map +1 -1
  18. package/lib/commonjs/modules/ios.js +27 -8
  19. package/lib/commonjs/modules/ios.js.map +1 -1
  20. package/lib/commonjs/modules/iosSk2.js.map +1 -1
  21. package/lib/commonjs/purchaseError.js.map +1 -1
  22. package/lib/commonjs/types/amazon.js.map +1 -1
  23. package/lib/commonjs/types/android.js.map +1 -1
  24. package/lib/commonjs/types/apple.js.map +1 -1
  25. package/lib/commonjs/types/appleSk2.js.map +1 -1
  26. package/lib/commonjs/types/index.js.map +1 -1
  27. package/lib/module/eventEmitter.js.map +1 -1
  28. package/lib/module/hooks/index.js.map +1 -1
  29. package/lib/module/hooks/useIAP.js.map +1 -1
  30. package/lib/module/hooks/withIAPContext.js.map +1 -1
  31. package/lib/module/iap.js.map +1 -1
  32. package/lib/module/index.js.map +1 -1
  33. package/lib/module/internal/enhancedFetch.js.map +1 -1
  34. package/lib/module/internal/fillProductsWithAdditionalData.js.map +1 -1
  35. package/lib/module/internal/index.js.map +1 -1
  36. package/lib/module/internal/platform.js.map +1 -1
  37. package/lib/module/modules/amazon.js.map +1 -1
  38. package/lib/module/modules/android.js.map +1 -1
  39. package/lib/module/modules/common.js.map +1 -1
  40. package/lib/module/modules/index.js.map +1 -1
  41. package/lib/module/modules/ios.js +27 -8
  42. package/lib/module/modules/ios.js.map +1 -1
  43. package/lib/module/modules/iosSk2.js.map +1 -1
  44. package/lib/module/purchaseError.js.map +1 -1
  45. package/lib/module/types/amazon.js.map +1 -1
  46. package/lib/module/types/android.js.map +1 -1
  47. package/lib/module/types/apple.js.map +1 -1
  48. package/lib/module/types/appleSk2.js.map +1 -1
  49. package/lib/module/types/index.js.map +1 -1
  50. package/lib/typescript/plugin/src/withIAP.d.ts +1 -0
  51. package/lib/typescript/plugin/src/withIAP.d.ts.map +1 -0
  52. package/lib/typescript/src/eventEmitter.d.ts +1 -0
  53. package/lib/typescript/src/eventEmitter.d.ts.map +1 -0
  54. package/lib/typescript/src/hooks/index.d.ts +1 -0
  55. package/lib/typescript/src/hooks/index.d.ts.map +1 -0
  56. package/lib/typescript/src/hooks/useIAP.d.ts +1 -0
  57. package/lib/typescript/src/hooks/useIAP.d.ts.map +1 -0
  58. package/lib/typescript/src/hooks/withIAPContext.d.ts +1 -0
  59. package/lib/typescript/src/hooks/withIAPContext.d.ts.map +1 -0
  60. package/lib/typescript/src/iap.d.ts +1 -0
  61. package/lib/typescript/src/iap.d.ts.map +1 -0
  62. package/lib/typescript/src/index.d.ts +1 -0
  63. package/lib/typescript/src/index.d.ts.map +1 -0
  64. package/lib/typescript/src/internal/enhancedFetch.d.ts +1 -1
  65. package/lib/typescript/src/internal/enhancedFetch.d.ts.map +1 -0
  66. package/lib/typescript/src/internal/fillProductsWithAdditionalData.d.ts +1 -0
  67. package/lib/typescript/src/internal/fillProductsWithAdditionalData.d.ts.map +1 -0
  68. package/lib/typescript/src/internal/index.d.ts +1 -0
  69. package/lib/typescript/src/internal/index.d.ts.map +1 -0
  70. package/lib/typescript/src/internal/platform.d.ts +1 -0
  71. package/lib/typescript/src/internal/platform.d.ts.map +1 -0
  72. package/lib/typescript/src/modules/amazon.d.ts +1 -0
  73. package/lib/typescript/src/modules/amazon.d.ts.map +1 -0
  74. package/lib/typescript/src/modules/android.d.ts +1 -0
  75. package/lib/typescript/src/modules/android.d.ts.map +1 -0
  76. package/lib/typescript/src/modules/common.d.ts +1 -0
  77. package/lib/typescript/src/modules/common.d.ts.map +1 -0
  78. package/lib/typescript/src/modules/index.d.ts +1 -0
  79. package/lib/typescript/src/modules/index.d.ts.map +1 -0
  80. package/lib/typescript/src/modules/ios.d.ts +30 -10
  81. package/lib/typescript/src/modules/ios.d.ts.map +1 -0
  82. package/lib/typescript/src/modules/iosSk2.d.ts +1 -0
  83. package/lib/typescript/src/modules/iosSk2.d.ts.map +1 -0
  84. package/lib/typescript/src/purchaseError.d.ts +1 -0
  85. package/lib/typescript/src/purchaseError.d.ts.map +1 -0
  86. package/lib/typescript/src/types/amazon.d.ts +1 -0
  87. package/lib/typescript/src/types/amazon.d.ts.map +1 -0
  88. package/lib/typescript/src/types/android.d.ts +1 -0
  89. package/lib/typescript/src/types/android.d.ts.map +1 -0
  90. package/lib/typescript/src/types/apple.d.ts +1 -0
  91. package/lib/typescript/src/types/apple.d.ts.map +1 -0
  92. package/lib/typescript/src/types/appleSk2.d.ts +2 -0
  93. package/lib/typescript/src/types/appleSk2.d.ts.map +1 -0
  94. package/lib/typescript/src/types/index.d.ts +1 -0
  95. package/lib/typescript/src/types/index.d.ts.map +1 -0
  96. package/package.json +19 -19
  97. package/src/modules/ios.ts +29 -10
  98. package/src/types/appleSk2.ts +1 -0
@@ -1 +1 @@
1
- {"version":3,"names":["ErrorCode","PurchaseError","constructor","name","message","responseCode","debugMessage","code","productId"],"sources":["purchaseError.ts"],"sourcesContent":["export enum ErrorCode {\n E_UNKNOWN = 'E_UNKNOWN',\n E_USER_CANCELLED = 'E_USER_CANCELLED',\n E_USER_ERROR = 'E_USER_ERROR',\n E_ITEM_UNAVAILABLE = 'E_ITEM_UNAVAILABLE',\n E_REMOTE_ERROR = 'E_REMOTE_ERROR',\n E_NETWORK_ERROR = 'E_NETWORK_ERROR',\n E_SERVICE_ERROR = 'E_SERVICE_ERROR',\n E_RECEIPT_FAILED = 'E_RECEIPT_FAILED',\n E_RECEIPT_FINISHED_FAILED = 'E_RECEIPT_FINISHED_FAILED',\n E_NOT_PREPARED = 'E_NOT_PREPARED',\n E_NOT_ENDED = 'E_NOT_ENDED',\n E_ALREADY_OWNED = 'E_ALREADY_OWNED',\n E_DEVELOPER_ERROR = 'E_DEVELOPER_ERROR',\n E_BILLING_RESPONSE_JSON_PARSE_ERROR = 'E_BILLING_RESPONSE_JSON_PARSE_ERROR',\n E_DEFERRED_PAYMENT = 'E_DEFERRED_PAYMENT',\n E_INTERRUPTED = 'E_INTERRUPTED',\n E_IAP_NOT_AVAILABLE = 'E_IAP_NOT_AVAILABLE',\n}\n\nexport class PurchaseError implements Error {\n constructor(\n public name: string,\n public message: string,\n public responseCode?: number,\n public debugMessage?: string,\n public code?: ErrorCode,\n public productId?: string,\n ) {\n this.name = '[react-native-iap]: PurchaseError';\n this.message = message;\n this.responseCode = responseCode;\n this.debugMessage = debugMessage;\n this.code = code;\n this.productId = productId;\n }\n}\n"],"mappings":"AAAA,WAAYA,SAAZ;;WAAYA,S;EAAAA,S;EAAAA,S;EAAAA,S;EAAAA,S;EAAAA,S;EAAAA,S;EAAAA,S;EAAAA,S;EAAAA,S;EAAAA,S;EAAAA,S;EAAAA,S;EAAAA,S;EAAAA,S;EAAAA,S;EAAAA,S;EAAAA,S;GAAAA,S,KAAAA,S;;AAoBZ,OAAO,MAAMC,aAAN,CAAqC;EAC1CC,WAAW,CACFC,IADE,EAEFC,OAFE,EAGFC,YAHE,EAIFC,YAJE,EAKFC,IALE,EAMFC,SANE,EAOT;IAAA,KANOL,IAMP,GANOA,IAMP;IAAA,KALOC,OAKP,GALOA,OAKP;IAAA,KAJOC,YAIP,GAJOA,YAIP;IAAA,KAHOC,YAGP,GAHOA,YAGP;IAAA,KAFOC,IAEP,GAFOA,IAEP;IAAA,KADOC,SACP,GADOA,SACP;IACA,KAAKL,IAAL,GAAY,mCAAZ;IACA,KAAKC,OAAL,GAAeA,OAAf;IACA,KAAKC,YAAL,GAAoBA,YAApB;IACA,KAAKC,YAAL,GAAoBA,YAApB;IACA,KAAKC,IAAL,GAAYA,IAAZ;IACA,KAAKC,SAAL,GAAiBA,SAAjB;EACD;;AAfyC"}
1
+ {"version":3,"names":["ErrorCode","PurchaseError","constructor","name","message","responseCode","debugMessage","code","productId"],"sourceRoot":"../../src","sources":["purchaseError.ts"],"mappings":"AAAA,WAAYA,SAAZ;;WAAYA,S;EAAAA,S;EAAAA,S;EAAAA,S;EAAAA,S;EAAAA,S;EAAAA,S;EAAAA,S;EAAAA,S;EAAAA,S;EAAAA,S;EAAAA,S;EAAAA,S;EAAAA,S;EAAAA,S;EAAAA,S;EAAAA,S;EAAAA,S;GAAAA,S,KAAAA,S;;AAoBZ,OAAO,MAAMC,aAAN,CAAqC;EAC1CC,WAAW,CACFC,IADE,EAEFC,OAFE,EAGFC,YAHE,EAIFC,YAJE,EAKFC,IALE,EAMFC,SANE,EAOT;IAAA,KANOL,IAMP,GANOA,IAMP;IAAA,KALOC,OAKP,GALOA,OAKP;IAAA,KAJOC,YAIP,GAJOA,YAIP;IAAA,KAHOC,YAGP,GAHOA,YAGP;IAAA,KAFOC,IAEP,GAFOA,IAEP;IAAA,KADOC,SACP,GADOA,SACP;IACA,KAAKL,IAAL,GAAY,mCAAZ;IACA,KAAKC,OAAL,GAAeA,OAAf;IACA,KAAKC,YAAL,GAAoBA,YAApB;IACA,KAAKC,YAAL,GAAoBA,YAApB;IACA,KAAKC,IAAL,GAAYA,IAAZ;IACA,KAAKC,SAAL,GAAiBA,SAAjB;EACD;;AAfyC"}
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["amazon.ts"],"sourcesContent":["export interface UserDataAmazon {\n userIdAmazon?: string;\n userMarketplaceAmazon?: string;\n userJsonAmazon?: string;\n}\n\nexport interface ProductPurchaseAmazon extends UserDataAmazon {\n isCanceledAmazon?: boolean;\n}\n/**\n * From: https://developer.amazon.com/es/docs/in-app-purchasing/iap-rvs-examples.html\n */\nexport type ReceiptType = {\n autoRenewing: boolean;\n betaProduct: boolean;\n cancelDate: number | null;\n cancelReason: string;\n deferredDate: number | null;\n deferredSku: number | null;\n freeTrialEndDate: number;\n gracePeriodEndDate: number;\n parentProductId: string;\n productId: string;\n productType: string;\n purchaseDate: number;\n quantity: number;\n receiptId: string;\n renewalDate: number;\n term: string;\n termSku: string;\n testTransaction: boolean;\n} & Record<string, unknown>;\n\nexport type AmazonLicensingStatus =\n | 'LICENSED'\n | 'NOT_LICENSED'\n | 'EXPIRED'\n | 'ERROR_VERIFICATION'\n | 'ERROR_INVALID_LICENSING_KEYS'\n | 'UNKNOWN_ERROR';\n"],"mappings":""}
1
+ {"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/amazon.ts"],"mappings":""}
@@ -1 +1 @@
1
- {"version":3,"names":["AndroidPurchaseState","AndroidPurchaseType","AndroidConsumptionState","AndroidAcknowledgementState","singleProductAndroidMap","originalProd","prod","price","oneTimePurchaseOfferDetails","formattedPrice","localizedPrice","currency","priceCurrencyCode"],"sources":["android.ts"],"sourcesContent":["import type {ProductAndroid} from '.';\n\nexport enum AndroidPurchaseState {\n purchased = 0,\n canceled = 1,\n pending = 2,\n}\n\nexport enum AndroidPurchaseType {\n test = 0,\n promo = 1,\n rewarded = 2,\n}\n\nexport enum AndroidConsumptionState {\n yet = 0,\n consumed = 1,\n}\n\nexport enum AndroidAcknowledgementState {\n yet = 0,\n acknowledged = 1,\n}\n\n/**\n * Get a list of products (consumable and non-consumable items, but not subscriptions)\n * @param {number} startTimeMillis The time the product was purchased, in milliseconds since the epoch (Jan 1, 1970).\n * @param {number} expiryTimeMillis The time the product expires, in milliseconds since the epoch (Jan 1, 1970).\n * @param {boolean} autoRenewing Check if it is a renewable product.\n * @param {string} priceCurrencyCode The price currency.\n * @param {number} priceAmountMicros Price amount int micros.\n * @param {string} countryCode Country code.\n * @param {string} developerPayload Developer payload.\n * @param {string} orderId Order id.\n * @param {AndroidPurchaseType} purchaseType Purchase type.\n * @param {AndroidAcknowledgementState} acknowledgementState Check if product is acknowledged.\n * @param {string} kind\n */\nexport type ReceiptType = {\n startTimeMillis: number;\n expiryTimeMillis: number;\n autoRenewing: boolean;\n priceCurrencyCode: string;\n priceAmountMicros: number;\n countryCode: string;\n developerPayload: string;\n orderId: string;\n consumptionState?: AndroidConsumptionState;\n purchaseState: AndroidPurchaseState;\n purchaseType: AndroidPurchaseType;\n acknowledgementState: AndroidAcknowledgementState;\n kind: string;\n} & Record<string, unknown>;\n\n/** Added to maintain backwards compatibility */\nexport const singleProductAndroidMap = (\n originalProd: ProductAndroid,\n): ProductAndroid => {\n const prod: ProductAndroid = {\n ...originalProd,\n //legacy properties\n price:\n originalProd.oneTimePurchaseOfferDetails?.formattedPrice ??\n originalProd.price,\n localizedPrice:\n originalProd.oneTimePurchaseOfferDetails?.formattedPrice ??\n originalProd.price,\n currency:\n originalProd.oneTimePurchaseOfferDetails?.priceCurrencyCode ??\n originalProd.currency,\n };\n return prod;\n};\n"],"mappings":"AAEA,WAAYA,oBAAZ;;WAAYA,oB;EAAAA,oB,CAAAA,oB;EAAAA,oB,CAAAA,oB;EAAAA,oB,CAAAA,oB;GAAAA,oB,KAAAA,oB;;AAMZ,WAAYC,mBAAZ;;WAAYA,mB;EAAAA,mB,CAAAA,mB;EAAAA,mB,CAAAA,mB;EAAAA,mB,CAAAA,mB;GAAAA,mB,KAAAA,mB;;AAMZ,WAAYC,uBAAZ;;WAAYA,uB;EAAAA,uB,CAAAA,uB;EAAAA,uB,CAAAA,uB;GAAAA,uB,KAAAA,uB;;AAKZ,WAAYC,2BAAZ;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;WAlBYA,2B;EAAAA,2B,CAAAA,2B;EAAAA,2B,CAAAA,2B;GAAAA,2B,KAAAA,2B;;AAmCZ;AACA,OAAO,MAAMC,uBAAuB,GAClCC,YADqC,IAElB;EAAA;;EACnB,MAAMC,IAAoB,GAAG,EAC3B,GAAGD,YADwB;IAE3B;IACAE,KAAK,EACH,0BAAAF,YAAY,CAACG,2BAAb,gFAA0CC,cAA1C,KACAJ,YAAY,CAACE,KALY;IAM3BG,cAAc,EACZ,2BAAAL,YAAY,CAACG,2BAAb,kFAA0CC,cAA1C,KACAJ,YAAY,CAACE,KARY;IAS3BI,QAAQ,EACN,2BAAAN,YAAY,CAACG,2BAAb,kFAA0CI,iBAA1C,KACAP,YAAY,CAACM;EAXY,CAA7B;EAaA,OAAOL,IAAP;AACD,CAjBM"}
1
+ {"version":3,"names":["AndroidPurchaseState","AndroidPurchaseType","AndroidConsumptionState","AndroidAcknowledgementState","singleProductAndroidMap","originalProd","prod","price","oneTimePurchaseOfferDetails","formattedPrice","localizedPrice","currency","priceCurrencyCode"],"sourceRoot":"../../../src","sources":["types/android.ts"],"mappings":"AAEA,WAAYA,oBAAZ;;WAAYA,oB;EAAAA,oB,CAAAA,oB;EAAAA,oB,CAAAA,oB;EAAAA,oB,CAAAA,oB;GAAAA,oB,KAAAA,oB;;AAMZ,WAAYC,mBAAZ;;WAAYA,mB;EAAAA,mB,CAAAA,mB;EAAAA,mB,CAAAA,mB;EAAAA,mB,CAAAA,mB;GAAAA,mB,KAAAA,mB;;AAMZ,WAAYC,uBAAZ;;WAAYA,uB;EAAAA,uB,CAAAA,uB;EAAAA,uB,CAAAA,uB;GAAAA,uB,KAAAA,uB;;AAKZ,WAAYC,2BAAZ;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;WAlBYA,2B;EAAAA,2B,CAAAA,2B;EAAAA,2B,CAAAA,2B;GAAAA,2B,KAAAA,2B;;AAmCZ;AACA,OAAO,MAAMC,uBAAuB,GAClCC,YADqC,IAElB;EAAA;;EACnB,MAAMC,IAAoB,GAAG,EAC3B,GAAGD,YADwB;IAE3B;IACAE,KAAK,EACH,0BAAAF,YAAY,CAACG,2BAAb,gFAA0CC,cAA1C,KACAJ,YAAY,CAACE,KALY;IAM3BG,cAAc,EACZ,2BAAAL,YAAY,CAACG,2BAAb,kFAA0CC,cAA1C,KACAJ,YAAY,CAACE,KARY;IAS3BI,QAAQ,EACN,2BAAAN,YAAY,CAACG,2BAAb,kFAA0CI,iBAA1C,KACAP,YAAY,CAACM;EAXY,CAA7B;EAaA,OAAOL,IAAP;AACD,CAjBM"}
@@ -1 +1 @@
1
- {"version":3,"names":["offerToRecord","offer","undefined","identifier","keyIdentifier","nonce","signature","timestamp","toString"],"sources":["apple.ts"],"sourcesContent":["/**\n * Payment discount interface @see https://developer.apple.com/documentation/storekit/skpaymentdiscount?language=objc\n */\nexport interface PaymentDiscount {\n /**\n * A string used to uniquely identify a discount offer for a product.\n */\n identifier: string;\n\n /**\n * A string that identifies the key used to generate the signature.\n */\n keyIdentifier: string;\n\n /**\n * A universally unique ID (UUID) value that you define.\n */\n nonce: string;\n\n /**\n * A UTF-8 string representing the properties of a specific discount offer, cryptographically signed.\n */\n signature: string;\n\n /**\n * The date and time of the signature's creation in milliseconds, formatted in Unix epoch time.\n */\n timestamp: number;\n}\n\nexport const offerToRecord = (\n offer: PaymentDiscount | undefined,\n): Record<keyof PaymentDiscount, string> | undefined => {\n if (!offer) {\n return undefined;\n }\n return {\n identifier: offer.identifier,\n keyIdentifier: offer.keyIdentifier,\n nonce: offer.nonce,\n signature: offer.signature,\n timestamp: offer.timestamp.toString(),\n };\n};\n"],"mappings":"AAAA;AACA;AACA;AA4BA,OAAO,MAAMA,aAAa,GACxBC,KAD2B,IAE2B;EACtD,IAAI,CAACA,KAAL,EAAY;IACV,OAAOC,SAAP;EACD;;EACD,OAAO;IACLC,UAAU,EAAEF,KAAK,CAACE,UADb;IAELC,aAAa,EAAEH,KAAK,CAACG,aAFhB;IAGLC,KAAK,EAAEJ,KAAK,CAACI,KAHR;IAILC,SAAS,EAAEL,KAAK,CAACK,SAJZ;IAKLC,SAAS,EAAEN,KAAK,CAACM,SAAN,CAAgBC,QAAhB;EALN,CAAP;AAOD,CAbM"}
1
+ {"version":3,"names":["offerToRecord","offer","undefined","identifier","keyIdentifier","nonce","signature","timestamp","toString"],"sourceRoot":"../../../src","sources":["types/apple.ts"],"mappings":"AAAA;AACA;AACA;AA4BA,OAAO,MAAMA,aAAa,GACxBC,KAD2B,IAE2B;EACtD,IAAI,CAACA,KAAL,EAAY;IACV,OAAOC,SAAP;EACD;;EACD,OAAO;IACLC,UAAU,EAAEF,KAAK,CAACE,UADb;IAELC,aAAa,EAAEH,KAAK,CAACG,aAFhB;IAGLC,KAAK,EAAEJ,KAAK,CAACI,KAHR;IAILC,SAAS,EAAEL,KAAK,CAACK,SAJZ;IAKLC,SAAS,EAAEN,KAAK,CAACM,SAAN,CAAgBC,QAAhB;EALN,CAAP;AAOD,CAbM"}
@@ -1 +1 @@
1
- {"version":3,"names":["SubscriptionPlatform","productSk2Map","id","description","displayName","price","displayPrice","prod","title","productId","String","type","localizedPrice","currency","subscriptionSk2Map","subscription","platform","ios","subscriptionPeriodNumberIOS","subscriptionPeriod","value","subscriptionPeriodUnitIOS","unit","toUpperCase","transactionSk2ToPurchaseMap","originalPurchaseDate","productID","purchaseDate","purchasedQuantity","originalID","purchase","transactionId","transactionDate","transactionReceipt","purchaseToken","quantityIOS","originalTransactionDateIOS","originalTransactionIdentifierIOS","offerSk2Map","offer","undefined","offerID","identifier","keyID","keyIdentifier","nonce","signature","timestamp","toString"],"sources":["appleSk2.ts"],"sourcesContent":["import type {PurchaseError} from '../purchaseError';\n\nimport type {\n ProductIOS,\n Purchase,\n SubscriptionIOS,\n SubscriptionIosPeriod,\n} from '.';\nimport type * as Apple from './apple';\nimport {SubscriptionPlatform} from '.';\n\nexport type SubscriptionPeriod = {\n unit: 'day' | 'week' | 'month' | 'year';\n value: number;\n};\n\nexport type PaymentMode = 'freeTrial' | 'payAsYouGo' | 'payUpFront';\n\nexport type SubscriptionOffer = {\n displayPrice: string;\n id: string;\n paymentMode: PaymentMode;\n period: SubscriptionPeriod;\n periodCount: number;\n price: number;\n type: 'introductory' | 'promotional';\n};\n\nexport type SubscriptionInfo = {\n introductoryOffer?: SubscriptionOffer;\n promotionalOffers?: SubscriptionOffer[];\n subscriptionGroupID: string;\n subscriptionPeriod: SubscriptionPeriod;\n};\n\nexport type RefundRequestStatus = 'success' | 'userCancelled';\n\nexport type ProductSk2 = {\n description: string;\n displayName: string;\n displayPrice: string;\n id: number;\n isFamilyShareable: boolean;\n jsonRepresentation: string;\n price: number;\n subscription: SubscriptionInfo;\n type: 'autoRenewable' | 'consumable' | 'nonConsumable' | 'nonRenewable';\n};\nexport const productSk2Map = ({\n id,\n description,\n displayName,\n price,\n displayPrice,\n}: ProductSk2): ProductIOS => {\n const prod: ProductIOS = {\n title: displayName,\n productId: String(id),\n description,\n type: 'iap',\n price: String(price),\n localizedPrice: displayPrice,\n currency: '', // Not avaiable on new API, use localizedPrice instead\n };\n return prod;\n};\n\nexport const subscriptionSk2Map = ({\n id,\n description,\n displayName,\n price,\n displayPrice,\n subscription,\n}: ProductSk2): SubscriptionIOS => {\n const prod: SubscriptionIOS = {\n platform: SubscriptionPlatform.ios,\n title: displayName,\n productId: String(id),\n description,\n type: 'subs',\n price: String(price),\n localizedPrice: displayPrice,\n currency: '', // Not avaiable on new API, use localizedPrice instead\n subscriptionPeriodNumberIOS: `${subscription?.subscriptionPeriod?.value}`,\n subscriptionPeriodUnitIOS:\n subscription?.subscriptionPeriod?.unit.toUpperCase() as SubscriptionIosPeriod,\n };\n return prod;\n};\n\nexport type TransactionSk2 = {\n appAccountToken: string;\n appBundleID: string;\n debugDescription: string;\n deviceVerification: string;\n deviceVerificationNonce: string;\n expirationDate: number;\n id: number;\n isUpgraded: boolean;\n jsonRepresentation: string;\n offerID: string;\n offerType: string;\n originalID: string;\n originalPurchaseDate: number;\n ownershipType: string;\n productID: string;\n productType: string;\n purchaseDate: number;\n purchasedQuantity: number;\n revocationDate: number;\n revocationReason: string;\n signedDate: number;\n subscriptionGroupID: number;\n webOrderLineItemID: number;\n};\n\nexport type TransactionError = PurchaseError;\n\n/**\n * Only one of `transaction` and `error` is not undefined at the time\n */\nexport type TransactionEvent = {\n transaction?: TransactionSk2;\n error?: TransactionError;\n};\n\nexport type SubscriptionStatus =\n | 'expired'\n | 'inBillingRetryPeriod'\n | 'inGracePeriod'\n | 'revoked'\n | 'subscribed';\n\nexport type ProductStatus = {\n state: SubscriptionStatus;\n};\n\nexport const transactionSk2ToPurchaseMap = ({\n id,\n originalPurchaseDate,\n productID,\n purchaseDate,\n purchasedQuantity,\n originalID,\n}: TransactionSk2): Purchase => {\n const purchase: Purchase = {\n productId: productID,\n transactionId: String(id),\n transactionDate: purchaseDate, //??\n transactionReceipt: '', // Not available\n purchaseToken: '', //Not avaiable\n quantityIOS: purchasedQuantity,\n originalTransactionDateIOS: originalPurchaseDate,\n originalTransactionIdentifierIOS: originalID,\n };\n return purchase;\n};\n\n/**\n * Payment discount interface @see https://developer.apple.com/documentation/storekit/skpaymentdiscount?language=objc\n */\nexport interface PaymentDiscountSk2 {\n /**\n * A string used to uniquely identify a discount offer for a product.\n */\n offerID: string;\n\n /**\n * A string that identifies the key used to generate the signature.\n */\n keyID: string;\n\n /**\n * A universally unique ID (UUID) value that you define.\n */\n nonce: string;\n\n /**\n * A UTF-8 string representing the properties of a specific discount offer, cryptographically signed.\n */\n signature: string;\n\n /**\n * The date and time of the signature's creation in milliseconds, formatted in Unix epoch time.\n */\n timestamp: number;\n}\n\nexport const offerSk2Map = (\n offer: Apple.PaymentDiscount | undefined,\n): Record<keyof PaymentDiscountSk2, string> | undefined => {\n if (!offer) {\n return undefined;\n }\n return {\n offerID: offer.identifier,\n keyID: offer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AaA,OAAOhB,IAAP;AACD,CAtBM;AAuEP,OAAO,MAAMiB,2BAA2B,GAAG,SAOX;EAAA,IAPY;IAC1CtB,EAD0C;IAE1CuB,oBAF0C;IAG1CC,SAH0C;IAI1CC,YAJ0C;IAK1CC,iBAL0C;IAM1CC;EAN0C,CAOZ;EAC9B,MAAMC,QAAkB,GAAG;IACzBrB,SAAS,EAAEiB,SADc;IAEzBK,aAAa,EAAErB,MAAM,CAACR,EAAD,CAFI;IAGzB8B,eAAe,EAAEL,YAHQ;IAGM;IAC/BM,kBAAkB,EAAE,EAJK;IAID;IACxBC,aAAa,EAAE,EALU;IAKN;IACnBC,WAAW,EAAEP,iBANY;IAOzBQ,0BAA0B,EAAEX,oBAPH;IAQzBY,gCAAgC,EAAER;EART,CAA3B;EAUA,OAAOC,QAAP;AACD,CAnBM;AAqBP;AACA;AACA;;AA4BA,OAAO,MAAMQ,WAAW,GACtBC,KADyB,IAEgC;EACzD,IAAI,CAACA,KAAL,EAAY;IACV,OAAOC,SAAP;EACD;;EACD,OAAO;IACLC,OAAO,EAAEF,KAAK,CAACG,UADV;IAELC,KAAK,EAAEJ,KAAK,CAACK,aAFR;IAGLC,KAAK,EAAEN,KAAK,CAACM,KAHR;IAILC,SAAS,EAAEP,KAAK,CAACO,SAJZ;IAKLC,SAAS,EAAER,KAAK,CAACQ,SAAN,CAAgBC,QAAhB;EALN,CAAP;AAOD,CAbM"}
1
+ {"version":3,"names":["SubscriptionPlatform","productSk2Map","id","description","displayName","price","displayPrice","prod","title","productId","String","type","localizedPrice","currency","subscriptionSk2Map","subscription","platform","ios","subscriptionPeriodNumberIOS","subscriptionPeriod","value","subscriptionPeriodUnitIOS","unit","toUpperCase","transactionSk2ToPurchaseMap","originalPurchaseDate","productID","purchaseDate","purchasedQuantity","originalID","purchase","transactionId","transactionDate","transactionReceipt","purchaseToken","quantityIOS","originalTransactionDateIOS","originalTransactionIdentifierIOS","offerSk2Map","offer","undefined","offerID","identifier","keyID","keyIdentifier","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AACD,CAtBM;AAwEP,OAAO,MAAMiB,2BAA2B,GAAG,SAOX;EAAA,IAPY;IAC1CtB,EAD0C;IAE1CuB,oBAF0C;IAG1CC,SAH0C;IAI1CC,YAJ0C;IAK1CC,iBAL0C;IAM1CC;EAN0C,CAOZ;EAC9B,MAAMC,QAAkB,GAAG;IACzBrB,SAAS,EAAEiB,SADc;IAEzBK,aAAa,EAAErB,MAAM,CAACR,EAAD,CAFI;IAGzB8B,eAAe,EAAEL,YAHQ;IAGM;IAC/BM,kBAAkB,EAAE,EAJK;IAID;IACxBC,aAAa,EAAE,EALU;IAKN;IACnBC,WAAW,EAAEP,iBANY;IAOzBQ,0BAA0B,EAAEX,oBAPH;IAQzBY,gCAAgC,EAAER;EART,CAA3B;EAUA,OAAOC,QAAP;AACD,CAnBM;AAqBP;AACA;AACA;;AA4BA,OAAO,MAAMQ,WAAW,GACtBC,KADyB,IAEgC;EACzD,IAAI,CAACA,KAAL,EAAY;IACV,OAAOC,SAAP;EACD;;EACD,OAAO;IACLC,OAAO,EAAEF,KAAK,CAACG,UADV;IAELC,KAAK,EAAEJ,KAAK,CAACK,aAFR;IAGLC,KAAK,EAAEN,KAAK,CAACM,KAHR;IAILC,SAAS,EAAEP,KAAK,CAACO,SAJZ;IAKLC,SAAS,EAAER,KAAK,CAACQ,SAAN,CAAgBC,QAAhB;EALN,CAAP;AAOD,CAbM"}
@@ -1 +1 @@
1
- {"version":3,"names":["ProrationModesAndroid","PurchaseStateAndroid","PROMOTED_PRODUCT","InstallSourceAndroid","ProductType","SubscriptionPlatform"],"sources":["index.ts"],"sourcesContent":["import type {\n AmazonModuleProps,\n AndroidModuleProps,\n IosModuleProps,\n} from '../modules';\nimport type {IosModulePropsSk2} from '../modules/iosSk2';\n\nimport type * as Apple from './apple';\n\nexport type Sku = string;\n\nexport enum ProrationModesAndroid {\n IMMEDIATE_WITH_TIME_PRORATION = 1,\n IMMEDIATE_AND_CHARGE_PRORATED_PRICE = 2,\n IMMEDIATE_WITHOUT_PRORATION = 3,\n DEFERRED = 4,\n IMMEDIATE_AND_CHARGE_FULL_PRICE = 5,\n UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY = 0,\n}\n\nexport enum PurchaseStateAndroid {\n UNSPECIFIED_STATE = 0,\n PURCHASED = 1,\n PENDING = 2,\n}\n\nexport const PROMOTED_PRODUCT = 'iap-promoted-product';\n\nexport enum InstallSourceAndroid {\n NOT_SET = 0,\n GOOGLE_PLAY = 1,\n AMAZON = 2,\n}\n\nexport enum ProductType {\n /** Subscription */\n subs = 'subs',\n\n /** Subscription */\n sub = 'sub',\n\n /** Consumable */\n inapp = 'inapp',\n\n /** Consumable */\n iap = 'iap',\n}\n\nexport interface ProductCommon {\n type: 'subs' | 'sub' | 'inapp' | 'iap';\n productId: string; //iOS\n productIds?: string[];\n title: string;\n description: string;\n price: string;\n currency: string;\n localizedPrice: string;\n countryCode?: string;\n}\n\nexport interface ProductPurchase {\n productId: string;\n transactionId?: string;\n transactionDate: number;\n transactionReceipt: string;\n purchaseToken?: string;\n //iOS\n quantityIOS?: number;\n originalTransactionDateIOS?: number;\n originalTransactionIdentifierIOS?: string;\n //Android\n productIds?: string[];\n dataAndroid?: string;\n signatureAndroid?: string;\n autoRenewingAndroid?: boolean;\n purchaseStateAndroid?: PurchaseStateAndroid;\n isAcknowledgedAndroid?: boolean;\n packageNameAndroid?: string;\n developerPayloadAndroid?: string;\n obfuscatedAccountIdAndroid?: string;\n obfuscatedProfileIdAndroid?: string;\n //Amazon\n userIdAmazon?: string;\n userMarketplaceAmazon?: string;\n userJsonAmazon?: string;\n isCanceledAmazon?: boolean;\n}\n\nexport interface PurchaseResult {\n responseCode?: number;\n debugMessage?: string;\n code?: string;\n message?: string;\n purchaseToken?: string;\n}\n\nexport interface SubscriptionPurchase extends ProductPurchase {\n autoRenewingAndroid?: boolean;\n originalTransactionDateIOS?: number;\n originalTransactionIdentifierIOS?: string;\n}\n\nexport type Purchase = ProductPurchase | SubscriptionPurchase;\n\nexport interface Discount {\n identifier: string;\n type: string;\n numberOfPeriods: string;\n price: string;\n localizedPrice: string;\n paymentMode: '' | 'FREETRIAL' | 'PAYASYOUGO' | 'PAYUPFRONT';\n subscriptionPeriod: string;\n}\n\nexport interface ProductAndroid extends ProductCommon {\n type: 'inapp' | 'iap';\n oneTimePurchaseOfferDetails?: {\n priceCurrencyCode: string;\n formattedPrice: string;\n priceAmountMicros: string;\n };\n}\nexport interface ProductIOS extends ProductCommon {\n type: 'inapp' | 'iap';\n}\n\nexport type Product = ProductAndroid & ProductIOS;\n\n/**\n * Can be used to distinguish the different platforms' subscription information\n */\nexport enum SubscriptionPlatform {\n android = 'android',\n amazon = 'amazon',\n ios = 'ios',\n}\n\n/** Android Billing v5 type */\nexport interface SubscriptionAndroid {\n platform: SubscriptionPlatform.android;\n productType: 'subs';\n name: string;\n title: string;\n description: string;\n productId: string;\n subscriptionOfferDetails: SubscriptionOfferAndroid[];\n}\n\nexport interface SubscriptionOfferAndroid {\n basePlanId: string;\n offerId: string | null;\n offerToken: string;\n pricingPhases: {\n pricingPhaseList: PricingPhaseAndroid[];\n };\n offerTags: string[];\n}\n\nexport interface PricingPhaseAndroid {\n formattedPrice: string;\n priceCurrencyCode: string;\n /**\n * P1W, P1M, P1Y\n */\n billingPeriod: string;\n billingCycleCount: number;\n priceAmountMicros: string;\n recurrenceMode: number;\n}\n\n/**\n * TODO: As of 2022-10-10, this typing is not verified against the real\n * Amazon API. Please update this if you have a more accurate type.\n */\nexport interface SubscriptionAmazon extends ProductCommon {\n platform: SubscriptionPlatform.amazon;\n type: 'subs';\n\n productType?: string;\n name?: string;\n}\n\nexport type SubscriptionIosPeriod = 'DAY' | 'WEEK' | 'MONTH' | 'YEAR' | '';\nexport interface SubscriptionIOS extends ProductCommon {\n platform: SubscriptionPlatform.ios;\n type: 'subs';\n discounts?: Discount[];\n introductoryPrice?: string;\n introductoryPriceAsAmountIOS?: string;\n introductoryPricePaymentModeIOS?:\n | ''\n | 'FREETRIAL'\n | 'PAYASYOUGO'\n | 'PAYUPFRONT';\n introductoryPriceNumberOfPeriodsIOS?: string;\n introductoryPriceSubscriptionPeriodIOS?: SubscriptionIosPeriod;\n\n subscriptionPeriodNumberIOS?: string;\n subscriptionPeriodUnitIOS?: SubscriptionIosPeriod;\n}\n\nexport type Subscription =\n | SubscriptionAndroid\n | SubscriptionAmazon\n | SubscriptionIOS;\n\nexport interface RequestPurchaseBaseAndroid {\n obfuscatedAccountIdAndroid?: string;\n obfuscatedProfileIdAndroid?: string;\n isOfferPersonalized?: boolean; // For AndroidBilling V5 https://developer.android.com/google/play/billing/integrate#personalized-price\n}\n\nexport interface RequestPurchaseAndroid extends RequestPurchaseBaseAndroid {\n skus: Sku[];\n}\n\nexport interface RequestPurchaseIOS {\n sku: Sku;\n andDangerouslyFinishTransactionAutomaticallyIOS?: boolean;\n /**\n * UUID representing user account\n */\n appAccountToken?: string;\n quantity?: number;\n withOffer?: Apple.PaymentDiscount;\n}\n\n/** As of 2022-10-12, we only use the `sku` field for Amazon purchases */\nexport type RequestPurchaseAmazon = RequestPurchaseIOS;\n\nexport type RequestPurchase =\n | RequestPurchaseAndroid\n | RequestPurchaseAmazon\n | RequestPurchaseIOS;\n\n/**\n * In order to purchase a new subscription, every sku must have a selected offerToken\n * @see SubscriptionAndroid.subscriptionOfferDetails.offerToken\n */\nexport interface SubscriptionOffer {\n sku: Sku;\n offerToken: string;\n}\n\nexport interface RequestSubscriptionAndroid extends RequestPurchaseBaseAndroid {\n purchaseTokenAndroid?: string;\n prorationModeAndroid?: ProrationModesAndroid;\n subscriptionOffers: SubscriptionOffer[];\n}\n\nexport type RequestSubscriptionIOS = RequestPurchaseIOS;\n\n/** As of 2022-10-12, we only use the `sku` field for Amazon subscriptions */\nexport type RequestSubscriptionAmazon = RequestSubscriptionIOS;\n\nexport type RequestSubscription =\n | RequestSubscriptionAndroid\n | RequestSubscriptionAmazon\n | RequestSubscriptionIOS;\n\ndeclare module 'react-native' {\n interface NativeModulesStatic {\n RNIapIos: IosModuleProps;\n RNIapIosSk2: IosModulePropsSk2;\n RNIapModule: AndroidModuleProps;\n RNIapAmazonModule: AmazonModuleProps;\n }\n}\n"],"mappings":"AAWA,WAAYA,qBAAZ;;WAAYA,qB;EAAAA,qB,CAAAA,qB;EAAAA,qB,CAAAA,qB;EAAAA,qB,CAAAA,qB;EAAAA,qB,CAAAA,qB;EAAAA,qB,CAAAA,qB;EAAAA,qB,CAAAA,qB;GAAAA,qB,KAAAA,qB;;AASZ,WAAYC,oBAAZ;;WAAYA,oB;EAAAA,oB,CAAAA,oB;EAAAA,oB,CAAAA,oB;EAAAA,oB,CAAAA,oB;GAAAA,oB,KAAAA,oB;;AAMZ,OAAO,MAAMC,gBAAgB,GAAG,sBAAzB;AAEP,WAAYC,oBAAZ;;WAAYA,oB;EAAAA,oB,CAAAA,oB;EAAAA,oB,CAAAA,oB;EAAAA,oB,CAAAA,oB;GAAAA,oB,KAAAA,oB;;AAMZ,WAAYC,WAAZ;;WAAYA,W;EAAAA,W;EAAAA,W;EAAAA,W;EAAAA,W;GAAAA,W,KAAAA,W;;AA8FZ;AACA;AACA;AACA,WAAYC,oBAAZ;AAMA;;WANYA,oB;EAAAA,oB;EAAAA,oB;EAAAA,oB;GAAAA,oB,KAAAA,oB"}
1
+ {"version":3,"names":["ProrationModesAndroid","PurchaseStateAndroid","PROMOTED_PRODUCT","InstallSourceAndroid","ProductType","SubscriptionPlatform"],"sourceRoot":"../../../src","sources":["types/index.ts"],"mappings":"AAWA,WAAYA,qBAAZ;;WAAYA,qB;EAAAA,qB,CAAAA,qB;EAAAA,qB,CAAAA,qB;EAAAA,qB,CAAAA,qB;EAAAA,qB,CAAAA,qB;EAAAA,qB,CAAAA,qB;EAAAA,qB,CAAAA,qB;GAAAA,qB,KAAAA,qB;;AASZ,WAAYC,oBAAZ;;WAAYA,oB;EAAAA,oB,CAAAA,oB;EAAAA,oB,CAAAA,oB;EAAAA,oB,CAAAA,oB;GAAAA,oB,KAAAA,oB;;AAMZ,OAAO,MAAMC,gBAAgB,GAAG,sBAAzB;AAEP,WAAYC,oBAAZ;;WAAYA,oB;EAAAA,oB,CAAAA,oB;EAAAA,oB,CAAAA,oB;EAAAA,oB,CAAAA,oB;GAAAA,oB,KAAAA,oB;;AAMZ,WAAYC,WAAZ;;WAAYA,W;EAAAA,W;EAAAA,W;EAAAA,W;EAAAA,W;GAAAA,W,KAAAA,W;;AA8FZ;AACA;AACA;AACA,WAAYC,oBAAZ;AAMA;;WANYA,oB;EAAAA,oB;EAAAA,oB;EAAAA,oB;GAAAA,oB,KAAAA,oB"}
@@ -7,3 +7,4 @@ interface Props {
7
7
  }
8
8
  declare const _default: ConfigPlugin<Props | undefined>;
9
9
  export default _default;
10
+ //# sourceMappingURL=withIAP.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withIAP.d.ts","sourceRoot":"","sources":["../../../../plugin/src/withIAP.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAsB,MAAM,sBAAsB,CAAC;AASvE,aAAK,eAAe,GAAG,iBAAiB,GAAG,MAAM,GAAG,YAAY,CAAC;AAuCjE,eAAO,MAAM,oBAAoB,gBAClB,MAAM,mBACF,eAAe,WAwBjC,CAAC;AAEF,eAAO,MAAM,wBAAwB,gBAAiB,MAAM,WAM3D,CAAC;AAyBF,UAAU,KAAK;IACb,eAAe,CAAC,EAAE,eAAe,CAAC;CACnC;;AA0BD,wBAAmE"}
@@ -148,3 +148,4 @@ const App = () => {
148
148
  * @platform iOS (Sk2)
149
149
  */
150
150
  export declare const transactionListener: (listener: (event: TransactionEvent) => void) => EmitterSubscription | null;
151
+ //# sourceMappingURL=eventEmitter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eventEmitter.d.ts","sourceRoot":"","sources":["../../../src/eventEmitter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAqB,MAAM,cAAc,CAAC;AAErE,OAAO,EAAC,gBAAgB,EAA8B,MAAM,kBAAkB,CAAC;AAG/E,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AACnD,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;AAEtC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,eAAO,MAAM,uBAAuB,qBAChB,QAAQ,KAAK,IAAI,wBAcpC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,eAAO,MAAM,qBAAqB,qBACd,aAAa,KAAK,IAAI,KACvC,mBAGF,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,eAAO,MAAM,uBAAuB,aAAc,MAAM,IAAI,+BAO3D,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,eAAO,MAAM,mBAAmB,qBACZ,gBAAgB,KAAK,IAAI,+BAQ5C,CAAC"}
@@ -1 +1,2 @@
1
1
  export * from './useIAP';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
@@ -29,3 +29,4 @@ declare type IAP_STATUS = {
29
29
  };
30
30
  export declare const useIAP: () => IAP_STATUS;
31
31
  export {};
32
+ //# sourceMappingURL=useIAP.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useIAP.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useIAP.ts"],"names":[],"mappings":"AAEA,OAAO,EAML,eAAe,IAAI,kBAAkB,EACrC,mBAAmB,IAAI,sBAAsB,EAC9C,MAAM,QAAQ,CAAC;AAChB,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAC,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE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24
24
  export declare function withIAPContext<T>(Component: React.ComponentType<T>): (props: T) => JSX.Element;
25
25
  export {};
26
+ //# sourceMappingURL=withIAPContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"withIAPContext.d.ts","sourceRoot":"","sources":["../../../../src/hooks/withIAPContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiD,MAAM,OAAO,CAAC;AAStE,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EACV,OAAO,EAEP,QAAQ,EACR,YAAY,EAEb,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAmB,cAAc,EAAC,MAAM,mBAAmB,CAAC;AAExE,aAAK,cAAc,GAAG;IACpB,SAAS,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,mBAAmB,EAAE,OAAO,EAAE,CAAC;IAC/B,aAAa,EAAE,YAAY,EAAE,CAAC;IAC9B,eAAe,EAAE,QAAQ,EAAE,CAAC;IAC5B,kBAAkB,EAAE,QAAQ,EAAE,CAAC;IAC/B,eAAe,CAAC,EAAE,QAAQ,CAAC;IAC3B,kBAAkB,CAAC,EAAE,cAAc,CAAC;IACpC,oBAAoB,CAAC,EAAE,aAAa,CAAC;IACrC,mBAAmB,CAAC,EAAE,KAAK,CAAC;IAC5B,WAAW,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,KAAK,IAAI,CAAC;IAC3C,gBAAgB,EAAE,CAAC,aAAa,EAAE,YAAY,EAAE,KAAK,IAAI,CAAC;IAC1D,kBAAkB,EAAE,CAAC,eAAe,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC;IAC1D,qBAAqB,EAAE,CAAC,kBAAkB,EAAE,QAAQ,EAAE,KAAK,IAAI,CAAC;IAChE,kBAAkB,EAAE,CAAC,eAAe,EAAE,QAAQ,GAAG,SAAS,KAAK,IAAI,CAAC;IACpE,uBAAuB,EAAE,CACvB,oBAAoB,EAAE,aAAa,GAAG,SAAS,KAC5C,IAAI,CAAC;CACX,CAAC;AAKF,wBAAgB,aAAa,IAAI,cAAc,CAQ9C;AAED,wBAAgB,cAAc,CAAC,CAAC,EAAE,SAAS,EAAE,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,WACzB,CAAC,iBAuH1C"}
@@ -440,3 +440,4 @@ export declare const deepLinkToSubscriptions: ({ sku, isAmazonDevice, }: {
440
440
  sku?: string | undefined;
441
441
  isAmazonDevice?: boolean | undefined;
442
442
  }) => Promise<void>;
443
+ //# sourceMappingURL=iap.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iap.d.ts","sourceRoot":"","sources":["../../../src/iap.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,SAAS,MAAM,kBAAkB,CAAC;AAC9C,OAAO,KAAK,UAAU,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AACxC,OAAO,KAAK,SAAS,MAAM,kBAAkB,CAAC;AAU9C,OAAO,EAOL,cAAc,EAIf,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,OAAO,EACP,eAAe,EAEf,QAAQ,EACR,cAAc,EAEd,eAAe,EACf,mBAAmB,EACnB,YAAY,EAKZ,oBAAoB,EACrB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAC,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,cAAc,EAAC,CAAC;AAMlE;;;;;;;;GAQG;AACH,oBAAY,gBAAgB,GACxB,gBAAgB,GAChB,sBAAsB,GACtB,gBAAgB,CAAC;AAErB,eAAO,MAAM,KAAK;;UAkBjB,CAAC;AAEF;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,cAAc,QAAO,QAAQ,OAAO,CACb,CAAC;AAErC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,aAAa,QAAO,QAAQ,OAAO,CACb,CAAC;AAEpC;;;GAGG;AACH,eAAO,MAAM,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
5
5
  export * from './hooks/withIAPContext';
6
6
  export * from './purchaseError';
7
7
  export * from './modules';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAC;AACtB,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC"}
@@ -1,6 +1,6 @@
1
- /// <reference types="react-native" />
2
1
  interface OverwrittenRequestInit extends Omit<RequestInit, 'body'> {
3
2
  body: Record<string, any>;
4
3
  }
5
4
  export declare const enhancedFetch: <T = any>(url: string, init?: OverwrittenRequestInit) => Promise<T>;
6
5
  export {};
6
+ //# sourceMappingURL=enhancedFetch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enhancedFetch.d.ts","sourceRoot":"","sources":["../../../../src/internal/enhancedFetch.ts"],"names":[],"mappings":"AAAA,UAAU,sBAAuB,SAAQ,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC;IAChE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CAC3B;AAED,eAAO,MAAM,aAAa,iBACnB,MAAM,SACJ,sBAAsB,eAkB9B,CAAC"}
@@ -4,3 +4,4 @@ import type { ProductCommon } from '../types';
4
4
  * since it isn't included in the product information.
5
5
  */
6
6
  export declare const fillProductsWithAdditionalData: <T extends ProductCommon>(items: T[]) => Promise<T[]>;
7
+ //# sourceMappingURL=fillProductsWithAdditionalData.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fillProductsWithAdditionalData.d.ts","sourceRoot":"","sources":["../../../../src/internal/fillProductsWithAdditionalData.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,UAAU,CAAC;AAI5C;;;GAGG;AACH,eAAO,MAAM,8BAA8B,uDAiC1C,CAAC"}
@@ -1,3 +1,4 @@
1
1
  export * from './enhancedFetch';
2
2
  export * from './fillProductsWithAdditionalData';
3
3
  export * from './platform';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/internal/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,kCAAkC,CAAC;AACjD,cAAc,YAAY,CAAC"}
@@ -22,3 +22,4 @@ export declare const storekit2Mode: () => boolean;
22
22
  export declare const storekit1Mode: () => boolean;
23
23
  export declare const storekitHybridMode: () => boolean;
24
24
  export declare const getIosModule: () => import("..").IosModuleProps | import("../modules/iosSk2").IosModulePropsSk2;
25
+ //# sourceMappingURL=platform.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../../../src/internal/platform.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,KAAK,SAAwB,CAAC;AAC3C,eAAO,MAAM,SAAS,SAA4B,CAAC;AACnD,eAAO,MAAM,QAAQ,SAAmC,CAAC;AACzD,eAAO,MAAM,MAAM,SAA6B,CAAC;AAMjD,eAAO,MAAM,sBAAsB,qDAEhC,IAEF,CAAC;AAEF,eAAO,MAAM,2BAA2B,QAAO,IAI9C,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,gBAAgB,wEAU5B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,oBAAoB,QAAO,SAAS,GAAG,QAAQ,GAAG,IAU9D,CAAC;AAEF,eAAO,MAAM,eAAe,sJAM3B,CAAC;AAMF,eAAO,MAAM,mBAAmB,QAAO,OACI,CAAC;AAE5C,eAAO,MAAM,cAAc,eAIJ,CAAC;AAExB,eAAO,MAAM,kBAAkB,iGAE5B,IAEF,CAAC;AAEF,eAAO,MAAM,aAAa,eAWzB,CAAC;AAEF,eAAO,MAAM,aAAa,eAOzB,CAAC;AAEF,eAAO,MAAM,kBAAkB,eAU9B,CAAC;AAQF,eAAO,MAAM,YAAY,mFAQxB,CAAC"}
@@ -52,3 +52,4 @@ export declare const deepLinkToSubscriptionsAmazon: ({ isAmazonDevice, }: {
52
52
  isAmazonDevice: boolean;
53
53
  }) => Promise<void>;
54
54
  export {};
55
+ //# sourceMappingURL=amazon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"amazon.d.ts","sourceRoot":"","sources":["../../../../src/modules/amazon.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAC,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAC,MAAM,UAAU,CAAC;AACrD,OAAO,KAAK,EACV,qBAAqB,EACrB,WAAW,EACX,cAAc,EACf,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,UAAU,CAAC;AAGhD,aAAK,OAAO,GAAG,MAAM,OAAO,CAAC,cAAc,CAAC,CAAC;AAC7C,aAAK,mCAAmC,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;AAClE,aAAK,cAAc,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;AACxE,aAAK,iBAAiB,GAAG,MAAM,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;AACnD,aAAK,aAAa,GAAG,CAAC,GAAG,EAAE,GAAG,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;AAErD,aAAK,mBAAmB,GAAG,CACzB,aAAa,EAAE,MAAM,EACrB,uBAAuB,CAAC,EAAE,MAAM,KAC7B,OAAO,CAAC,OAAO,CAAC,CAAC;AAEtB,aAAK,cAAc,GAAG,CACpB,aAAa,EAAE,MAAM,EACrB,uBAAuB,CAAC,EAAE,MAAM,KAC7B,OAAO,CAAC,OAAO,CAAC,CAAC;AAEtB,aAAK,cAAc,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;AAE1C,MAAM,WAAW,iBAAkB,SAAQ,iBAAiB;IAC1D,OAAO,EAAE,OAAO,CAAC;IACjB,mCAAmC,EAAE,mCAAmC,CAAC;IACzE,cAAc,EAAE,cAAc,CAAC;IAC/B,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,aAAa,EAAE,aAAa,CAAC;IAC7B,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,cAAc,EAAE,cAAc,CAAC;IAC/B,qFAAqF;IACrF,cAAc,EAAE,cAAc,CAAC;IAC/B,aAAa,EAAE,MAAM,OAAO,CAAC,qBAAqB,CAAC,CAAC;IACpD,uBAAuB,EAAE,CAAC,cAAc,EAAE,OAAO,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CACrE;AAED,eAAO,MAAM,YAAY,mBAC6B,CAAC;AAEvD;;;;;;;;;GASG;AACH,eAAO,MAAM,qBAAqB;qBAMf,MAAM;YACf,MAAM;eACH,MAAM;gBACL,OAAO;MACjB,QAAQ,WAAW,CAKtB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,aAAa,QAAa,QAAQ,qBAAqB,CACtC,CAAC;AAE/B;;;;GAIG;AACH,eAAO,MAAM,6BAA6B;oBAGxB,OAAO;MACrB,QAAQ,IAAI,CAAyD,CAAC"}
@@ -60,3 +60,4 @@ export declare const acknowledgePurchaseAndroid: ({ token, developerPayload, }:
60
60
  developerPayload?: string | undefined;
61
61
  }) => Promise<PurchaseResult | boolean | void>;
62
62
  export {};
63
+ //# sourceMappingURL=android.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"android.d.ts","sourceRoot":"","sources":["../../../../src/modules/android.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,oBAAoB,EACpB,OAAO,EACP,WAAW,EACX,qBAAqB,EACrB,QAAQ,EACR,cAAc,EACd,GAAG,EACJ,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,KAAK,OAAO,MAAM,kBAAkB,CAAC;AAEjD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AW,kBAAmB,SAAQ,iBAAiB;IAC3D,mCAAmC,EAAE,mCAAmC,CAAC;IACzE,cAAc,EAAE,cAAc,CAAC;IAC/B,uBAAuB,EAAE,uBAAuB,CAAC;IACjD,wBAAwB,EAAE,wBAAwB,CAAC;IACnD,aAAa,EAAE,aAAa,CAAC;IAC7B,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,cAAc,EAAE,cAAc,CAAC;IAC/B,qFAAqF;IACrF,cAAc,EAAE,cAAc,CAAC;IAC/B,cAAc,EAAE,cAAc,CAAC;CAChC;AAED,eAAO,MAAM,aAAa,oBAAkD,CAAC;AAE7E,eAAO,MAAM,uBAAuB,QAAO,oBAI1C,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,8BAA8B;SAGpC,GAAG;MACN,QAAQ,IAAI,CAMf,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,sBAAsB;iBAOpB,MAAM;eACR,MAAM;kBACH,MAAM;iBACP,MAAM;;MAEjB,QAAQ,QAAQ,WAAW,CAsB9B,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,0BAA0B;WAI9B,MAAM;;MAEX,QAAQ,cAAc,GAAG,OAAO,GAAG,IAAI,CAE1C,CAAC"}
@@ -11,3 +11,4 @@ export interface NativeModuleProps {
11
11
  /** removeListeners for NativeEventEmitter */
12
12
  removeListeners(count: number): void;
13
13
  }
14
+ //# sourceMappingURL=common.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../src/modules/common.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,6DAA6D;IAC7D,cAAc,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAEnC,6DAA6D;IAC7D,aAAa,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAElC,yCAAyC;IACzC,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAErC,6CAA6C;IAC7C,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtC"}
@@ -2,3 +2,4 @@ export * from './amazon';
2
2
  export * from './android';
3
3
  export * from './ios';
4
4
  export * from './common';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/modules/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,OAAO,CAAC;AACtB,cAAc,UAAU,CAAC"}
@@ -9,7 +9,7 @@ declare type clearTransaction = () => Promise<void>;
9
9
  declare type clearProducts = () => Promise<void>;
10
10
  declare type promotedProduct = () => Promise<ProductIOS | null>;
11
11
  declare type buyPromotedProduct = () => Promise<void>;
12
- declare type requestReceipt = (refresh: boolean) => Promise<string>;
12
+ declare type requestReceipt = (refresh: boolean) => Promise<string | undefined | null>;
13
13
  declare type finishTransaction = (transactionIdentifier: string) => Promise<boolean>;
14
14
  declare type getPendingTransactions = () => Promise<ProductPurchase[]>;
15
15
  declare type presentCodeRedemptionSheet = () => Promise<null>;
@@ -29,29 +29,48 @@ export interface IosModuleProps extends NativeModuleProps {
29
29
  }
30
30
  /**
31
31
  * Get the current receipt base64 encoded in IOS.
32
- * @param {forceRefresh?:boolean}
33
32
  * @returns {Promise<ProductPurchase[]>}
34
33
  */
35
34
  export declare const getPendingPurchasesIOS: () => Promise<ProductPurchase[]>;
36
35
  /**
37
36
  * Get the current receipt base64 encoded in IOS.
37
+ *
38
+ * The sequence should be as follows:
39
+ * Call getReceiptIOS({forceRefresh: false}). That will return the cached receipt that is available on TestFlight and Production.
40
+ * In the case of Sandbox the receipt might not be cached, causing it to return nil.
41
+ * In that case you might want to let the user that they will to be prompted for credentials.
42
+ * If they accept, call it again with `getReceiptIOS({forceRefresh:true}) If it fails or the user declines, assume they haven't purchased any items.
43
+ * Reference: https://developer.apple.com/forums/thread/662350
44
+ *
38
45
  * From: https://apphud.com/blog/app-store-receipt-validation#what-is-app-store-receipt
39
- > Does a receipt always exist in the app?
40
- > If a user downloaded the app from the App Store – yes. However, in sandbox if your app was installed via Xcode or Testflight, then there won't be a receipt until you make a purchase or restore.
46
+ > Q: Does a receipt always exist in the app?
47
+ > A: If a user downloaded the app from the App Store – yes. However, in sandbox if your app was installed via Xcode or Testflight, then there won't be a receipt until you make a purchase or restore.
41
48
  *
42
49
  ## Usage
43
50
  ```tsx
44
- import {useCallback} from 'react';
45
51
  import {getReceiptIOS} from 'react-native-iap';
46
-
47
- const receipt = useCallback(async () => await getReceiptIOS({forceRefresh: false}));
52
+ try{
53
+ let receipt = await getReceiptIOS({forceRefresh: false});
54
+ if(!receipt){
55
+ // Let user know that they might get prompted for credentials
56
+ const shouldShowPrompt = // Display UI with details, Did user agree?. this only for Sandbox testing
57
+ if(shouldShowPrompt){
58
+ receipt = await getReceiptIOS({forceRefresh: true});
59
+ }
60
+ }
61
+ }catch(error:Error){
62
+ // error while getting the receipt, it might indicate an invalid receipt of a connection error while trying to get it
63
+ }
64
+ // If !receipt assume user doesn't own the items
48
65
  ```
49
- * @param {forceRefresh?:boolean} Requests the receipt from Bundle.main.appStoreReceiptURL. Based on the note above, looks like forceRefresh only makes sense when testing an app not downloaded from the Appstore.
50
- * @returns {Promise<string>} The receipt data
66
+ * @param {forceRefresh?:boolean} Requests the receipt from Bundle.main.appStoreReceiptURL.
67
+ Based on the note above, looks like forceRefresh only makes sense when testing an app not downloaded from the Appstore.
68
+ And only afer a direct user action.
69
+ * @returns {Promise<string | undefined | null>} The receipt data
51
70
  */
52
71
  export declare const getReceiptIOS: ({ forceRefresh, }: {
53
72
  forceRefresh?: boolean | undefined;
54
- }) => Promise<string>;
73
+ }) => Promise<string | undefined | null>;
55
74
  /**
56
75
  * Launches a modal to register the redeem offer code in IOS.
57
76
  * @returns {Promise<null>}
@@ -95,3 +114,4 @@ export declare const clearTransactionIOS: () => Promise<void>;
95
114
  export declare const clearProductsIOS: () => Promise<void>;
96
115
  export declare const deepLinkToSubscriptionsIos: () => Promise<void>;
97
116
  export {};
117
+ //# sourceMappingURL=ios.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ios.d.ts","sourceRoot":"","sources":["../../../../src/modules/ios.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,YAAY,IAAI,yBAAyB,EAAC,MAAM,+BAA+B,CAAC;AAI7F,OAAO,KAAK,EACV,UAAU,EACV,eAAe,EACf,QAAQ,EACR,GAAG,EACH,eAAe,EAChB,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,gBAAgB,CAAC;AAEpD,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,UAAU,CAAC;AAEhD,aAAK,QAAQ,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,UAAU,EAAE,GAAG,eAAe,EAAE,CAAC,CAAC;AAE3E,aAAK,iBAAiB,GAAG,CACvB,uCAAuC,EAAE,OAAO,KAC7C,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;AAEzB,oBAAY,UAAU,GAAG,CACvB,GAAG,EAAE,GAAG,EACR,+CAA+C,EAAE,OAAO,EACxD,mBAAmB,EAAE,MAAM,GAAG,SAAS,EACvC,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,CAAC,MAAM,eAAe,EAAE,MAAM,CAAC,GAAG,SAAS,KACzD,OAAO,CAAC,QAAQ,CAAC,CAAC;AAEvB,aAAK,gBAAgB,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;AAC5C,aAAK,aAAa,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;AACzC,aAAK,eAAe,GAAG,MAAM,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAAC;AACxD,aAAK,kBAAkB,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;AAC9C,aAAK,cAAc,GAAG,CAAC,OAAO,E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,MAAM,kBAAkB;iBAIhB,OAAO,MAAM,EAAE,OAAO,CAAC;;MAElC,QAAQ,yBAAyB,GAAG,KAAK,CAY5C,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,QAAO,QAAQ,IAAI,CAChB,CAAC;AAEpC;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,QAAO,QAAQ,IAAI,CAChB,CAAC;AAEjC,eAAO,MAAM,0BAA0B,QAAO,QAAQ,IAAI,CACO,CAAC"}
@@ -59,3 +59,4 @@ export declare const latestTransaction: (sku: string) => Promise<TransactionSk2>
59
59
  */
60
60
  export declare const beginRefundRequest: (sku: string) => Promise<RefundRequestStatus>;
61
61
  export {};
62
+ //# sourceMappingURL=iosSk2.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"iosSk2.d.ts","sourceRoot":"","sources":["../../../../src/modules/iosSk2.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAC,OAAO,EAAE,eAAe,EAAE,GAAG,EAAC,MAAM,UAAU,CAAC;AAC5D,OAAO,KAAK,EACV,kBAAkB,EAClB,UAAU,EACV,aAAa,EACb,mBAAmB,EACnB,cAAc,EACf,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,UAAU,CAAC;AAGhD,aAAK,QAAQ,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC;AAEvD,aAAK,iBAAiB,GAAG,CACvB,0BAA0B,CAAC,EAAE,OAAO,EACpC,sBAAsB,CAAC,EAAE,OAAO,KAC7B,OAAO,CAAC,cAAc,EAAE,CAAC,CAAC;AAE/B,oBAAY,UAAU,GAAG,CACvB,GAAG,EAAE,GAAG,EACR,+CAA+C,EAAE,OAAO,EACxD,mBAAmB,EAAE,MAAM,GAAG,SAAS,EACvC,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,CAAC,MAAM,kBAAkB,EAA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;IACjC,kBAAkB,EAAE,kBAAkB,CAAC;IACvC,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,sBAAsB,EAAE,sBAAsB,CAAC;IAC/C,0BAA0B,EAAE,0BAA0B,CAAC;IACvD,uBAAuB,EAAE,uBAAuB,CAAC;IACjD,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7B,kBAAkB,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,mBAAmB,CAAC,CAAC;CACnE;AAED;;;GAGG;AACH,eAAO,MAAM,IAAI,QAAO,QAAQ,IAAI,CAAuB,CAAC;AAE5D;;GAEG;AACH,eAAO,MAAM,uBAAuB,YAAa,MAAM,KAAG,QAAQ,OAAO,CAC3B,CAAC;AAE/C;;GAEG;AAEH,eAAO,MAAM,kBAAkB,QAAS,MAAM,KAAG,QAAQ,aAAa,EAAE,CACnC,CAAC;AAEtC;;GAEG;AACH,eAAO,MAAM,kBAAkB,QAAS,MAAM,KAAG,QAAQ,cAAc,CAClC,CAAC;AAEtC;;GAEG;AACH,eAAO,MAAM,iBAAiB,QAAS,MAAM,KAAG,QAAQ,cAAc,CAClC,CAAC;AAErC;;GAEG;AACH,eAAO,MAAM,kBAAkB,QAAS,MAAM,KAAG,QAAQ,mBAAmB,CACvC,CAAC"}
@@ -26,3 +26,4 @@ export declare class PurchaseError implements Error {
26
26
  productId?: string | undefined;
27
27
  constructor(name: string, message: string, responseCode?: number | undefined, debugMessage?: string | undefined, code?: ErrorCode | undefined, productId?: string | undefined);
28
28
  }
29
+ //# sourceMappingURL=purchaseError.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"purchaseError.d.ts","sourceRoot":"","sources":["../../../src/purchaseError.ts"],"names":[],"mappings":"AAAA,oBAAY,SAAS;IACnB,SAAS,cAAc;IACvB,gBAAgB,qBAAqB;IACrC,YAAY,iBAAiB;IAC7B,kBAAkB,uBAAuB;IACzC,cAAc,mBAAmB;IACjC,eAAe,oBAAoB;IACnC,eAAe,oBAAoB;IACnC,gBAAgB,qBAAqB;IACrC,yBAAyB,8BAA8B;IACvD,cAAc,mBAAmB;IACjC,WAAW,gBAAgB;IAC3B,eAAe,oBAAoB;IACnC,iBAAiB,sBAAsB;IACvC,mCAAmC,wCAAwC;IAC3E,kBAAkB,uBAAuB;IACzC,aAAa,kBAAkB;IAC/B,mBAAmB,wBAAwB;CAC5C;AAED,qBAAa,aAAc,YAAW,KAAK;IAEhC,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,MAAM;IACf,YAAY,CAAC;IACb,YAAY,CAAC;IACb,IAAI,CAAC;IACL,SAAS,CAAC;gBALV,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,YAAY,CAAC,oBAAQ,EACrB,YAAY,CAAC,oBAAQ,EACrB,IAAI,CAAC,uBAAW,EAChB,SAAS,CAAC,oBAAQ;CAS5B"}
@@ -30,3 +30,4 @@ export declare type ReceiptType = {
30
30
  testTransaction: boolean;
31
31
  } & Record<string, unknown>;
32
32
  export declare type AmazonLicensingStatus = 'LICENSED' | 'NOT_LICENSED' | 'EXPIRED' | 'ERROR_VERIFICATION' | 'ERROR_INVALID_LICENSING_KEYS' | 'UNKNOWN_ERROR';
33
+ //# sourceMappingURL=amazon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"amazon.d.ts","sourceRoot":"","sources":["../../../../src/types/amazon.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,qBAAsB,SAAQ,cAAc;IAC3D,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC5B;AACD;;GAEG;AACH,oBAAY,WAAW,GAAG;IACxB,YAAY,EAAE,OAAO,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,gBAAgB,EAAE,MAAM,CAAC;IACzB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,OAAO,CAAC;CAC1B,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE5B,oBAAY,qBAAqB,GAC7B,UAAU,GACV,cAAc,GACd,SAAS,GACT,oBAAoB,GACpB,8BAA8B,GAC9B,eAAe,CAAC"}
@@ -48,3 +48,4 @@ export declare type ReceiptType = {
48
48
  } & Record<string, unknown>;
49
49
  /** Added to maintain backwards compatibility */
50
50
  export declare const singleProductAndroidMap: (originalProd: ProductAndroid) => ProductAndroid;
51
+ //# sourceMappingURL=android.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"android.d.ts","sourceRoot":"","sources":["../../../../src/types/android.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,GAAG,CAAC;AAEtC,oBAAY,oBAAoB;IAC9B,SAAS,IAAI;IACb,QAAQ,IAAI;IACZ,OAAO,IAAI;CACZ;AAED,oBAAY,mBAAmB;IAC7B,IAAI,IAAI;IACR,KAAK,IAAI;IACT,QAAQ,IAAI;CACb;AAED,oBAAY,uBAAuB;IACjC,GAAG,IAAI;IACP,QAAQ,IAAI;CACb;AAED,oBAAY,2BAA2B;IACrC,GAAG,IAAI;IACP,YAAY,IAAI;CACjB;AAED;;;;;;;;;;;;;GAaG;AACH,oBAAY,WAAW,GAAG;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,YAAY,EAAE,OAAO,CAAC;IACtB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,gBAAgB,CAAC,EAAE,uBAAuB,CAAC;IAC3C,aAAa,EAAE,oBAAoB,CAAC;IACpC,YAAY,EAAE,mBAAmB,CAAC;IAClC,oBAAoB,EAAE,2BAA2B,CAAC;IAClD,IAAI,EAAE,MAAM,CAAC;CACd,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE5B,gDAAgD;AAChD,eAAO,MAAM,uBAAuB,iBACpB,cAAc,KAC3B,cAeF,CAAC"}
@@ -24,3 +24,4 @@ export interface PaymentDiscount {
24
24
  timestamp: number;
25
25
  }
26
26
  export declare const offerToRecord: (offer: PaymentDiscount | undefined) => Record<keyof PaymentDiscount, string> | undefined;
27
+ //# sourceMappingURL=apple.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"apple.d.ts","sourceRoot":"","sources":["../../../../src/types/apple.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,aAAa,UACjB,eAAe,GAAG,SAAS,KACjC,OAAO,MAAM,eAAe,EAAE,MAAM,CAAC,GAAG,SAW1C,CAAC"}
@@ -42,6 +42,7 @@ export declare type TransactionSk2 = {
42
42
  deviceVerification: string;
43
43
  deviceVerificationNonce: string;
44
44
  expirationDate: number;
45
+ environment?: 'Production' | 'Sandbox' | 'Xcode';
45
46
  id: number;
46
47
  isUpgraded: boolean;
47
48
  jsonRepresentation: string;
@@ -99,3 +100,4 @@ export interface PaymentDiscountSk2 {
99
100
  timestamp: number;
100
101
  }
101
102
  export declare const offerSk2Map: (offer: Apple.PaymentDiscount | undefined) => Record<keyof PaymentDiscountSk2, string> | undefined;
103
+ //# sourceMappingURL=appleSk2.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"appleSk2.d.ts","sourceRoot":"","sources":["../../../../src/types/appleSk2.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,kBAAkB,CAAC;AAEpD,OAAO,KAAK,EACV,UAAU,EACV,QAAQ,EACR,eAAe,EAEhB,MAAM,GAAG,CAAC;AACX,OAAO,KAAK,KAAK,KAAK,MAAM,SAAS,CAAC;AAGtC,oBAAY,kBAAkB,GAAG;IAC/B,IAAI,EAAE,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;IACxC,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,oBAAY,WAAW,GAAG,WAAW,GAAG,YAAY,GAAG,YAAY,CAAC;AAEpE,oBAAY,iBAAiB,GAAG;IAC9B,YAAY,EAAE,MAAM,CAAC;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,WAAW,CAAC;IACzB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,cAAc,GAAG,aAAa,CAAC;CACtC,CAAC;AAEF,oBAAY,gBAAgB,GAAG;IAC7B,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,iBAAiB,CAAC,EAAE,iBAAiB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BAAiB,EAAE,MAAM,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,gBAAgB,EAAE,MAAM,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,mBAAmB,EAAE,MAAM,CAAC;IAC5B,kBAAkB,EAAE,MAAM,CAAC;CAC5B,CAAC;AAEF,oBAAY,gBAAgB,GAAG,aAAa,CAAC;AAE7C;;GAEG;AACH,oBAAY,gBAAgB,GAAG;IAC7B,WAAW,CAAC,EAAE,cAAc,CAAC;IAC7B,KAAK,CAAC,EAAE,gBAAgB,CAAC;CAC1B,CAAC;AAEF,oBAAY,kBAAkB,GAC1B,SAAS,GACT,sBAAsB,GACtB,eAAe,GACf,SAAS,GACT,YAAY,CAAC;AAEjB,oBAAY,aAAa,GAAG;IAC1B,KAAK,EAAE,kBAAkB,CAAC;CAC3B,CAAC;AAEF,eAAO,MAAM,2BAA2B,0FAOrC,cAAc,KAAG,QAYnB,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,WAAW,UACf,MAAM,eAAe,GAAG,SAAS,KACvC,OAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,GAAG,SAW7C,CAAC"}
@@ -208,3 +208,4 @@ declare module 'react-native' {
208
208
  RNIapAmazonModule: AmazonModuleProps;
209
209
  }
210
210
  }
211
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACf,MAAM,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AAC,EAAE,OAAO,CAAC;IAC1D;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,KAAK,CAAC,eAAe,CAAC;CACnC;AAED,yEAAyE;AACzE,oBAAY,qBAAqB,GAAG,kBAAkB,CAAC;AAEvD,oBAAY,eAAe,GACvB,sBAAsB,GACtB,qBAAqB,GACrB,kBAAkB,CAAC;AAEvB;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,GAAG,CAAC;IACT,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,0BAA2B,SAAQ,0BAA0B;IAC5E,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,oBAAoB,CAAC,EAAE,qBAAqB,CAAC;IAC7C,kBAAkB,EAAE,iBAAiB,EAAE,CAAC;CACzC;AAED,oBAAY,sBAAsB,GAAG,kBAAkB,CAAC;AAExD,6EAA6E;AAC7E,oBAAY,yBAAyB,GAAG,sBAAsB,CAAC;AAE/D,oBAAY,mBAAmB,GAC3B,0BAA0B,GAC1B,yBAAyB,GACzB,sBAAsB,CAAC;AAE3B,OAAO,QAAQ,cAAc,CAAC;IAC5B,UAAU,mBAAmB;QAC3B,QAAQ,EAAE,cAAc,CAAC;QACzB,WAAW,EAAE,iBAAiB,CAAC;QAC/B,WAAW,EAAE,kBAAkB,CAAC;QAChC,iBAAiB,EAAE,iBAAiB,CAAC;KACtC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-iap",
3
- "version": "12.8.2",
3
+ "version": "12.8.4",
4
4
  "description": "React Native In App Purchase Module.",
5
5
  "repository": "https://github.com/dooboolab/react-native-iap",
6
6
  "author": "dooboolab <support@dooboolab.com> (https://github.com/dooboolab)",
@@ -75,41 +75,41 @@
75
75
  "lint:plugin": "eslint plugin/src/*"
76
76
  },
77
77
  "devDependencies": {
78
- "@babel/eslint-parser": "7.18.9",
78
+ "@babel/eslint-parser": "7.21.3",
79
79
  "@firmnav/eslint-github-actions-formatter": "1.0.1",
80
- "@jeremybarbet/apple-api-types": "1.3.5",
81
- "@jeremybarbet/google-api-types": "1.3.5",
82
- "@react-native-community/eslint-config": "3.1.0",
83
- "@release-it/conventional-changelog": "5.0.0",
84
- "@testing-library/jest-native": "4.0.5",
85
- "@testing-library/react-native": "11.0.0",
86
- "@types/jest": "28.1.6",
80
+ "@jeremybarbet/apple-api-types": "1.4.0",
81
+ "@jeremybarbet/google-api-types": "1.4.0",
82
+ "@react-native-community/eslint-config": "3.2.0",
83
+ "@release-it/conventional-changelog": "5.1.1",
84
+ "@testing-library/jest-native": "4.0.13",
85
+ "@testing-library/react-native": "11.5.4",
86
+ "@types/jest": "28.1.8",
87
87
  "@types/react": "~17.0.47",
88
88
  "@types/react-native": "0.68.2",
89
- "@typescript-eslint/eslint-plugin": "5.32.0",
90
- "@typescript-eslint/parser": "5.32.0",
89
+ "@typescript-eslint/eslint-plugin": "5.55.0",
90
+ "@typescript-eslint/parser": "5.55.0",
91
91
  "babel-jest": "28.1.3",
92
- "eslint": "8.20.0",
93
- "eslint-config-prettier": "8.5.0",
94
- "eslint-plugin-jest": "26.8.2",
92
+ "eslint": "8.36.0",
93
+ "eslint-config-prettier": "8.7.0",
94
+ "eslint-plugin-jest": "26.9.0",
95
95
  "eslint-plugin-prettier": "4.2.1",
96
96
  "eslint-plugin-simple-import-sort": "7.0.0",
97
97
  "expo-module-scripts": "^3.0.4",
98
98
  "jest": "28.1.3",
99
99
  "monolinter": "1.0.4",
100
100
  "pod-install": "0.1.38",
101
- "prettier": "2.7.1",
101
+ "prettier": "2.8.4",
102
102
  "react": "17.0.2",
103
103
  "react-native": "0.68.2",
104
- "react-native-builder-bob": "0.18.3",
105
- "release-it": "15.2.0",
106
- "ts-jest": "28.0.7",
104
+ "react-native-builder-bob": "0.20.4",
105
+ "release-it": "15.9.0",
106
+ "ts-jest": "28.0.8",
107
107
  "typedoc": "^0.23.14",
108
108
  "typedoc-plugin-markdown": "^3.13.6",
109
109
  "typescript": "4.7.4"
110
110
  },
111
111
  "resolutions": {
112
- "@types/react": "17.0.21"
112
+ "@types/react": "17.0.53"
113
113
  },
114
114
  "peerDependencies": {
115
115
  "react": ">=16.13.1",
@@ -32,7 +32,7 @@ type clearTransaction = () => Promise<void>;
32
32
  type clearProducts = () => Promise<void>;
33
33
  type promotedProduct = () => Promise<ProductIOS | null>;
34
34
  type buyPromotedProduct = () => Promise<void>;
35
- type requestReceipt = (refresh: boolean) => Promise<string>;
35
+ type requestReceipt = (refresh: boolean) => Promise<string | undefined | null>;
36
36
 
37
37
  type finishTransaction = (transactionIdentifier: string) => Promise<boolean>;
38
38
 
@@ -56,7 +56,6 @@ export interface IosModuleProps extends NativeModuleProps {
56
56
 
57
57
  /**
58
58
  * Get the current receipt base64 encoded in IOS.
59
- * @param {forceRefresh?:boolean}
60
59
  * @returns {Promise<ProductPurchase[]>}
61
60
  */
62
61
  export const getPendingPurchasesIOS = async (): Promise<ProductPurchase[]> =>
@@ -64,25 +63,45 @@ export const getPendingPurchasesIOS = async (): Promise<ProductPurchase[]> =>
64
63
 
65
64
  /**
66
65
  * Get the current receipt base64 encoded in IOS.
66
+ *
67
+ * The sequence should be as follows:
68
+ * Call getReceiptIOS({forceRefresh: false}). That will return the cached receipt that is available on TestFlight and Production.
69
+ * In the case of Sandbox the receipt might not be cached, causing it to return nil.
70
+ * In that case you might want to let the user that they will to be prompted for credentials.
71
+ * If they accept, call it again with `getReceiptIOS({forceRefresh:true}) If it fails or the user declines, assume they haven't purchased any items.
72
+ * Reference: https://developer.apple.com/forums/thread/662350
73
+ *
67
74
  * From: https://apphud.com/blog/app-store-receipt-validation#what-is-app-store-receipt
68
- > Does a receipt always exist in the app?
69
- > If a user downloaded the app from the App Store – yes. However, in sandbox if your app was installed via Xcode or Testflight, then there won't be a receipt until you make a purchase or restore.
75
+ > Q: Does a receipt always exist in the app?
76
+ > A: If a user downloaded the app from the App Store – yes. However, in sandbox if your app was installed via Xcode or Testflight, then there won't be a receipt until you make a purchase or restore.
70
77
  *
71
78
  ## Usage
72
79
  ```tsx
73
- import {useCallback} from 'react';
74
80
  import {getReceiptIOS} from 'react-native-iap';
75
-
76
- const receipt = useCallback(async () => await getReceiptIOS({forceRefresh: false}));
81
+ try{
82
+ let receipt = await getReceiptIOS({forceRefresh: false});
83
+ if(!receipt){
84
+ // Let user know that they might get prompted for credentials
85
+ const shouldShowPrompt = // Display UI with details, Did user agree?. this only for Sandbox testing
86
+ if(shouldShowPrompt){
87
+ receipt = await getReceiptIOS({forceRefresh: true});
88
+ }
89
+ }
90
+ }catch(error:Error){
91
+ // error while getting the receipt, it might indicate an invalid receipt of a connection error while trying to get it
92
+ }
93
+ // If !receipt assume user doesn't own the items
77
94
  ```
78
- * @param {forceRefresh?:boolean} Requests the receipt from Bundle.main.appStoreReceiptURL. Based on the note above, looks like forceRefresh only makes sense when testing an app not downloaded from the Appstore.
79
- * @returns {Promise<string>} The receipt data
95
+ * @param {forceRefresh?:boolean} Requests the receipt from Bundle.main.appStoreReceiptURL.
96
+ Based on the note above, looks like forceRefresh only makes sense when testing an app not downloaded from the Appstore.
97
+ And only afer a direct user action.
98
+ * @returns {Promise<string | undefined | null>} The receipt data
80
99
  */
81
100
  export const getReceiptIOS = async ({
82
101
  forceRefresh,
83
102
  }: {
84
103
  forceRefresh?: boolean;
85
- }): Promise<string> => {
104
+ }): Promise<string | undefined | null> => {
86
105
  if (!isIosStorekit2()) {
87
106
  return RNIapIos.requestReceipt(forceRefresh ?? false);
88
107
  } else {