react-native-iap 12.7.4 → 12.8.1
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.
- package/ios/IapSerializationUtils.swift +2 -2
- package/lib/commonjs/eventEmitter.js +0 -5
- package/lib/commonjs/eventEmitter.js.map +1 -1
- package/lib/commonjs/modules/amazon.js.map +1 -1
- package/lib/commonjs/modules/android.js.map +1 -1
- package/lib/module/eventEmitter.js +1 -6
- package/lib/module/eventEmitter.js.map +1 -1
- package/lib/module/modules/amazon.js.map +1 -1
- package/lib/module/modules/android.js.map +1 -1
- package/lib/typescript/src/modules/amazon.d.ts +1 -0
- package/lib/typescript/src/modules/android.d.ts +1 -0
- package/package.json +1 -1
- package/src/eventEmitter.ts +1 -11
- package/src/modules/amazon.ts +1 -0
- package/src/modules/android.ts +1 -0
|
@@ -138,11 +138,11 @@ func serialize(_ ot: Product.SubscriptionOffer.OfferType?) -> String? {
|
|
|
138
138
|
}
|
|
139
139
|
@available(iOS 15.0, tvOS 15.0, *)
|
|
140
140
|
func serialize(_ t: Transaction) -> [String: Any?] {
|
|
141
|
-
return ["appAccountToken": t.appAccountToken,
|
|
141
|
+
return ["appAccountToken": t.appAccountToken?.uuidString,
|
|
142
142
|
"appBundleID": t.appBundleID,
|
|
143
143
|
"debugDescription": serializeDebug(t.debugDescription),
|
|
144
144
|
"deviceVerification": t.deviceVerification,
|
|
145
|
-
"deviceVerificationNonce": t.deviceVerificationNonce,
|
|
145
|
+
"deviceVerificationNonce": t.deviceVerificationNonce.uuidString,
|
|
146
146
|
"expirationDate": t.expirationDate?.millisecondsSince1970,
|
|
147
147
|
"id": t.id,
|
|
148
148
|
"isUpgraded": t.isUpgraded,
|
|
@@ -51,11 +51,6 @@ const purchaseUpdatedListener = listener => {
|
|
|
51
51
|
listener((0, _appleSk.transactionSk2ToPurchaseMap)(event));
|
|
52
52
|
} : listener;
|
|
53
53
|
const emitterSubscription = eventEmitter.addListener('purchase-updated', proxyListener);
|
|
54
|
-
|
|
55
|
-
if (_internal.isAndroid) {
|
|
56
|
-
(0, _internal.getAndroidModule)().startListening();
|
|
57
|
-
}
|
|
58
|
-
|
|
59
54
|
return emitterSubscription;
|
|
60
55
|
};
|
|
61
56
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["purchaseUpdatedListener","listener","eventEmitter","NativeEventEmitter","getNativeModule","proxyListener","isIosStorekit2","event","transactionSk2ToPurchaseMap","emitterSubscription","addListener","
|
|
1
|
+
{"version":3,"names":["purchaseUpdatedListener","listener","eventEmitter","NativeEventEmitter","getNativeModule","proxyListener","isIosStorekit2","event","transactionSk2ToPurchaseMap","emitterSubscription","addListener","purchaseErrorListener","promotedProductListener","isIos","getIosModule","transactionListener"],"sources":["eventEmitter.ts"],"sourcesContent":["import {EmitterSubscription, NativeEventEmitter} from 'react-native';\n\nimport {TransactionEvent, transactionSk2ToPurchaseMap} from './types/appleSk2';\nimport {isIosStorekit2} from './iap';\nimport {getIosModule, getNativeModule, isIos} from './internal';\nimport type {PurchaseError} from './purchaseError';\nimport type {Purchase} from './types';\n\n/**\n * Add IAP purchase event\n * Register a callback that gets called when the store has any updates to purchases that have not yet been finished, consumed or acknowledged. Returns a React Native `EmitterSubscription` on which you can call `.remove()` to stop receiving updates. Register you listener as soon as possible and react to updates at all times.\n\n## Signature\n\n```ts\npurchaseUpdatedListener((purchase: Purchase) => {});\n```\n\n## Usage\n\n```tsx\nimport React, {useEffect} from 'react';\nimport {View} from 'react-native';\nimport {purchaseUpdatedListener} from 'react-native-iap';\n\nconst App = () => {\n useEffect(() => {\n const subscription = purchaseUpdatedListener((purchase: Purchase) => {\n console.log(purchase);\n });\n\n return () => {\n subscription.remove();\n };\n }, []);\n\n return <View />;\n};\n```\n */\nexport const purchaseUpdatedListener = (\n listener: (event: Purchase) => void,\n) => {\n const eventEmitter = new NativeEventEmitter(getNativeModule());\n const proxyListener = isIosStorekit2()\n ? (event: Purchase) => {\n listener(transactionSk2ToPurchaseMap(event as any));\n }\n : listener;\n const emitterSubscription = eventEmitter.addListener(\n 'purchase-updated',\n proxyListener,\n );\n\n return emitterSubscription;\n};\n\n/**\n * Add IAP purchase error event\n * Register a callback that gets called when there has been an error with a purchase. Returns a React Native `EmitterSubscription` on which you can call `.remove()` to stop receiving updates.\n\n## Signature\n\n```ts\npurchaseErrorListener((error: PurchaseError) => {});\n```\n\n## Usage\n\n```tsx\nimport React, {useEffect} from 'react';\nimport {View} from 'react-native';\nimport {purchaseErrorListener} from 'react-native-iap';\n\nconst App = () => {\n useEffect(() => {\n const subscription = purchaseErrorListener((error: PurchaseError) => {\n console.log(error);\n });\n\n return () => {\n subscription.remove();\n };\n }, []);\n\n return <View />;\n};\n```\n\n */\nexport const purchaseErrorListener = (\n listener: (error: PurchaseError) => void,\n): EmitterSubscription => {\n const eventEmitter = new NativeEventEmitter(getNativeModule());\n return eventEmitter.addListener('purchase-error', listener);\n};\n\n/**\n * Add IAP promoted subscription event\n * Add IAP promoted subscription event.\n\n## Signature\n\n```ts\npromotedProductListener((productId?: string) => {});\n```\n\n## Usage\n\n```tsx\nimport React, {useEffect} from 'react';\nimport {View} from 'react-native';\nimport {promotedProductListener} from 'react-native-iap';\n\nconst App = () => {\n useEffect(() => {\n const subscription = promotedProductListener((productId) => {\n console.log(productId);\n });\n\n return () => {\n subscription.remove();\n };\n }, []);\n\n return <View />;\n};\n```\n\n *\n * @platform iOS\n */\nexport const promotedProductListener = (listener: () => void) => {\n if (isIos && !isIosStorekit2()) {\n const eventEmitter = new NativeEventEmitter(getIosModule());\n return eventEmitter.addListener('iap-promoted-product', listener);\n }\n\n return null;\n};\n\n/**\n * Updated transactions for iOS Sk2\n * Register a callback that gets called when the store has any updates to transactions related to purchases that have not yet been finished, consumed or acknowledged. \n * Returns a React Native `EmitterSubscription` on which you can call `.remove()` to stop receiving updates. Register you listener as soon as possible and react to updates at all times.\n\n**Warning**\nThis is only available for iOS 15 and higher and Storekit 2 is activated\n\n## Signature\n\n```ts\npurchaseUpdatedListener((transactionOrError: TransactionOrError) => {});\n```\n\n## Usage\n\n```tsx\nimport React, {useEffect} from 'react';\nimport {View} from 'react-native';\nimport {purchaseUpdatedListener} from 'react-native-iap';\n\nconst App = () => {\n useEffect(() => {\n const subscription = purchaseUpdatedListener((transactionOrError: TransactionOrError) => {\n if(transactionOrError.transaction){\n console.log(\"There's an update to a transaction\", transactionOrError.transaction);\n }else{\n console.log(\"There's been an error with a received transaction\")\n }\n });\n\n return () => {\n subscription.remove();\n };\n }, []);\n\n return <View />;\n};\n```\n *\n * @platform iOS (Sk2)\n */\nexport const transactionListener = (\n listener: (event: TransactionEvent) => void,\n) => {\n if (isIos && isIosStorekit2()) {\n const eventEmitter = new NativeEventEmitter(getIosModule());\n return eventEmitter.addListener('iap-transaction-updated', listener);\n }\n\n return null;\n};\n"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AACA;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,uBAAuB,GAClCC,QADqC,IAElC;EACH,MAAMC,YAAY,GAAG,IAAIC,+BAAJ,CAAuB,IAAAC,yBAAA,GAAvB,CAArB;EACA,MAAMC,aAAa,GAAG,IAAAC,mBAAA,MACjBC,KAAD,IAAqB;IACnBN,QAAQ,CAAC,IAAAO,oCAAA,EAA4BD,KAA5B,CAAD,CAAR;EACD,CAHiB,GAIlBN,QAJJ;EAKA,MAAMQ,mBAAmB,GAAGP,YAAY,CAACQ,WAAb,CAC1B,kBAD0B,EAE1BL,aAF0B,CAA5B;EAKA,OAAOI,mBAAP;AACD,CAfM;AAiBP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AACO,MAAME,qBAAqB,GAChCV,QADmC,IAEX;EACxB,MAAMC,YAAY,GAAG,IAAIC,+BAAJ,CAAuB,IAAAC,yBAAA,GAAvB,CAArB;EACA,OAAOF,YAAY,CAACQ,WAAb,CAAyB,gBAAzB,EAA2CT,QAA3C,CAAP;AACD,CALM;AAOP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AACO,MAAMW,uBAAuB,GAAIX,QAAD,IAA0B;EAC/D,IAAIY,eAAA,IAAS,CAAC,IAAAP,mBAAA,GAAd,EAAgC;IAC9B,MAAMJ,YAAY,GAAG,IAAIC,+BAAJ,CAAuB,IAAAW,sBAAA,GAAvB,CAArB;IACA,OAAOZ,YAAY,CAACQ,WAAb,CAAyB,sBAAzB,EAAiDT,QAAjD,CAAP;EACD;;EAED,OAAO,IAAP;AACD,CAPM;AASP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AACO,MAAMc,mBAAmB,GAC9Bd,QADiC,IAE9B;EACH,IAAIY,eAAA,IAAS,IAAAP,mBAAA,GAAb,EAA+B;IAC7B,MAAMJ,YAAY,GAAG,IAAIC,+BAAJ,CAAuB,IAAAW,sBAAA,GAAvB,CAArB;IACA,OAAOZ,YAAY,CAACQ,WAAb,CAAyB,yBAAzB,EAAoDT,QAApD,CAAP;EACD;;EAED,OAAO,IAAP;AACD,CATM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["AmazonModule","NativeModules","RNIapAmazonModule","validateReceiptAmazon","developerSecret","userId","receiptId","useSandbox","sandBoxUrl","url","enhancedFetch","verifyLicense","deepLinkToSubscriptionsAmazon","isAmazonDevice","deepLinkToSubscriptions"],"sources":["amazon.ts"],"sourcesContent":["import {NativeModules} from 'react-native';\n\nimport {enhancedFetch} from '../internal';\nimport type {Product, Purchase, Sku} from '../types';\nimport type {\n AmazonLicensingStatus,\n ReceiptType,\n UserDataAmazon,\n} from '../types/amazon';\n\nimport type {NativeModuleProps} from './common';\n// ----------\n\ntype GetUser = () => Promise<UserDataAmazon>;\ntype FlushFailedPurchasesCachedAsPending = () => Promise<boolean>;\ntype GetItemsByType = (type: string, skus: Sku[]) => Promise<Product[]>;\ntype GetAvailableItems = () => Promise<Purchase[]>;\ntype BuyItemByType = (sku: Sku) => Promise<Purchase>;\n\ntype AcknowledgePurchase = (\n purchaseToken: string,\n developerPayloadAndroid?: string,\n) => Promise<boolean>;\n\ntype ConsumeProduct = (\n purchaseToken: string,\n developerPayloadAndroid?: string,\n) => Promise<boolean>;\n\ntype StartListening = () => Promise<void>;\n\nexport interface AmazonModuleProps extends NativeModuleProps {\n getUser: GetUser;\n flushFailedPurchasesCachedAsPending: FlushFailedPurchasesCachedAsPending;\n getItemsByType: GetItemsByType;\n getAvailableItems: GetAvailableItems;\n buyItemByType: BuyItemByType;\n acknowledgePurchase: AcknowledgePurchase;\n consumeProduct: ConsumeProduct;\n startListening: StartListening;\n verifyLicense: () => Promise<AmazonLicensingStatus>;\n deepLinkToSubscriptions: (isAmazonDevice: boolean) => Promise<void>;\n}\n\nexport const AmazonModule =\n NativeModules.RNIapAmazonModule as AmazonModuleProps;\n\n/**\n * Validate receipt for Amazon. NOTE: This method is here for debugging purposes only. Including\n * your developer secret in the binary you ship to users is potentially dangerous.\n * Use server side validation instead for your production builds\n * @param {string} developerSecret: from the Amazon developer console.\n * @param {string} userId who purchased the item.\n * @param {string} receiptId long obfuscated string returned when purchasing the item\n * @param {boolean} useSandbox Defaults to true, use sandbox environment or production.\n * @returns {Promise<object>}\n */\nexport const validateReceiptAmazon = async ({\n developerSecret,\n userId,\n receiptId,\n useSandbox = true,\n}: {\n developerSecret: string;\n userId: string;\n receiptId: string;\n useSandbox: boolean;\n}): Promise<ReceiptType> => {\n const sandBoxUrl = useSandbox ? 'sandbox/' : '';\n const url = `https://appstore-sdk.amazon.com/${sandBoxUrl}version/1.0/verifyReceiptId/developer/${developerSecret}/user/${userId}/receiptId/${receiptId}`;\n\n return await enhancedFetch<ReceiptType>(url);\n};\n\n/**\n * Returns the status of verifying app's license @see AmazonLicensingStatus\n */\nexport const verifyLicense = async (): Promise<AmazonLicensingStatus> =>\n AmazonModule.verifyLicense();\n\n/**\n * Deep link to subscriptions screen on Android.\n * @param {string} sku The product's SKU (on Android)\n * @returns {Promise<void>}\n */\nexport const deepLinkToSubscriptionsAmazon = async ({\n isAmazonDevice,\n}: {\n isAmazonDevice: boolean;\n}): Promise<void> => AmazonModule.deepLinkToSubscriptions(isAmazonDevice);\n"],"mappings":";;;;;;;AAAA;;AAEA;;
|
|
1
|
+
{"version":3,"names":["AmazonModule","NativeModules","RNIapAmazonModule","validateReceiptAmazon","developerSecret","userId","receiptId","useSandbox","sandBoxUrl","url","enhancedFetch","verifyLicense","deepLinkToSubscriptionsAmazon","isAmazonDevice","deepLinkToSubscriptions"],"sources":["amazon.ts"],"sourcesContent":["import {NativeModules} from 'react-native';\n\nimport {enhancedFetch} from '../internal';\nimport type {Product, Purchase, Sku} from '../types';\nimport type {\n AmazonLicensingStatus,\n ReceiptType,\n UserDataAmazon,\n} from '../types/amazon';\n\nimport type {NativeModuleProps} from './common';\n// ----------\n\ntype GetUser = () => Promise<UserDataAmazon>;\ntype FlushFailedPurchasesCachedAsPending = () => Promise<boolean>;\ntype GetItemsByType = (type: string, skus: Sku[]) => Promise<Product[]>;\ntype GetAvailableItems = () => Promise<Purchase[]>;\ntype BuyItemByType = (sku: Sku) => Promise<Purchase>;\n\ntype AcknowledgePurchase = (\n purchaseToken: string,\n developerPayloadAndroid?: string,\n) => Promise<boolean>;\n\ntype ConsumeProduct = (\n purchaseToken: string,\n developerPayloadAndroid?: string,\n) => Promise<boolean>;\n\ntype StartListening = () => Promise<void>;\n\nexport interface AmazonModuleProps extends NativeModuleProps {\n getUser: GetUser;\n flushFailedPurchasesCachedAsPending: FlushFailedPurchasesCachedAsPending;\n getItemsByType: GetItemsByType;\n getAvailableItems: GetAvailableItems;\n buyItemByType: BuyItemByType;\n acknowledgePurchase: AcknowledgePurchase;\n consumeProduct: ConsumeProduct;\n /** @deprecated to be renamed to sendUnconsumedPurchases if not removed completely */\n startListening: StartListening;\n verifyLicense: () => Promise<AmazonLicensingStatus>;\n deepLinkToSubscriptions: (isAmazonDevice: boolean) => Promise<void>;\n}\n\nexport const AmazonModule =\n NativeModules.RNIapAmazonModule as AmazonModuleProps;\n\n/**\n * Validate receipt for Amazon. NOTE: This method is here for debugging purposes only. Including\n * your developer secret in the binary you ship to users is potentially dangerous.\n * Use server side validation instead for your production builds\n * @param {string} developerSecret: from the Amazon developer console.\n * @param {string} userId who purchased the item.\n * @param {string} receiptId long obfuscated string returned when purchasing the item\n * @param {boolean} useSandbox Defaults to true, use sandbox environment or production.\n * @returns {Promise<object>}\n */\nexport const validateReceiptAmazon = async ({\n developerSecret,\n userId,\n receiptId,\n useSandbox = true,\n}: {\n developerSecret: string;\n userId: string;\n receiptId: string;\n useSandbox: boolean;\n}): Promise<ReceiptType> => {\n const sandBoxUrl = useSandbox ? 'sandbox/' : '';\n const url = `https://appstore-sdk.amazon.com/${sandBoxUrl}version/1.0/verifyReceiptId/developer/${developerSecret}/user/${userId}/receiptId/${receiptId}`;\n\n return await enhancedFetch<ReceiptType>(url);\n};\n\n/**\n * Returns the status of verifying app's license @see AmazonLicensingStatus\n */\nexport const verifyLicense = async (): Promise<AmazonLicensingStatus> =>\n AmazonModule.verifyLicense();\n\n/**\n * Deep link to subscriptions screen on Android.\n * @param {string} sku The product's SKU (on Android)\n * @returns {Promise<void>}\n */\nexport const deepLinkToSubscriptionsAmazon = async ({\n isAmazonDevice,\n}: {\n isAmazonDevice: boolean;\n}): Promise<void> => AmazonModule.deepLinkToSubscriptions(isAmazonDevice);\n"],"mappings":";;;;;;;AAAA;;AAEA;;AA2CO,MAAMA,YAAY,GACvBC,0BAAA,CAAcC,iBADT;AAGP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;AACO,MAAMC,qBAAqB,GAAG,cAUT;EAAA,IAVgB;IAC1CC,eAD0C;IAE1CC,MAF0C;IAG1CC,SAH0C;IAI1CC,UAAU,GAAG;EAJ6B,CAUhB;EAC1B,MAAMC,UAAU,GAAGD,UAAU,GAAG,UAAH,GAAgB,EAA7C;EACA,MAAME,GAAG,GAAI,mCAAkCD,UAAW,yCAAwCJ,eAAgB,SAAQC,MAAO,cAAaC,SAAU,EAAxJ;EAEA,OAAO,MAAM,IAAAI,uBAAA,EAA2BD,GAA3B,CAAb;AACD,CAfM;AAiBP;AACA;AACA;;;;;AACO,MAAME,aAAa,GAAG,YAC3BX,YAAY,CAACW,aAAb,EADK;AAGP;AACA;AACA;AACA;AACA;;;;;AACO,MAAMC,6BAA6B,GAAG;EAAA,IAAO;IAClDC;EADkD,CAAP;EAAA,OAIxBb,YAAY,CAACc,uBAAb,CAAqCD,cAArC,CAJwB;AAAA,CAAtC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["RNIapModule","NativeModules","AndroidModule","getInstallSourceAndroid","InstallSourceAndroid","GOOGLE_PLAY","AMAZON","deepLinkToSubscriptionsAndroid","sku","checkNativeAndroidAvailable","Linking","openURL","getPackageName","validateReceiptAndroid","packageName","productId","productToken","accessToken","isSub","type","url","response","fetch","method","headers","ok","Object","assign","Error","statusText","statusCode","status","json","acknowledgePurchaseAndroid","token","developerPayload","getAndroidModule","acknowledgePurchase"],"sources":["android.ts"],"sourcesContent":["import {Linking, NativeModules} from 'react-native';\n\nimport {checkNativeAndroidAvailable, getAndroidModule} from '../internal';\nimport {\n InstallSourceAndroid,\n Product,\n ProductType,\n ProrationModesAndroid,\n Purchase,\n PurchaseResult,\n Sku,\n} from '../types';\nimport type * as Android from '../types/android';\n\nimport type {NativeModuleProps} from './common';\n\nconst {RNIapModule} = NativeModules;\n\ntype FlushFailedPurchasesCachedAsPending = () => Promise<boolean>;\n\ntype GetItemsByType = <T = Product>(\n type: ProductType,\n skus: Sku[],\n) => Promise<T[]>;\n\ntype GetAvailableItemsByType = <T = Purchase>(\n type: ProductType,\n) => Promise<T[]>;\n\ntype GetPurchaseHistoryByType = <T = Purchase>(\n type: ProductType,\n) => Promise<T[]>;\n\nexport type BuyItemByType = (\n type: string,\n skus: Sku[],\n purchaseToken: string | undefined,\n prorationMode: ProrationModesAndroid | -1,\n obfuscatedAccountId: string | undefined,\n obfuscatedProfileId: string | undefined,\n subscriptionOffers: string[],\n isOfferPersonalized: boolean,\n) => Promise<Purchase>;\n\ntype AcknowledgePurchase = (\n purchaseToken: string,\n developerPayloadAndroid?: string,\n) => Promise<PurchaseResult | boolean>;\n\ntype ConsumeProduct = (\n purchaseToken: string,\n developerPayloadAndroid?: string,\n) => Promise<PurchaseResult | boolean>;\n\ntype StartListening = () => Promise<void>;\ntype GetPackageName = () => Promise<string>;\n\nexport interface AndroidModuleProps extends NativeModuleProps {\n flushFailedPurchasesCachedAsPending: FlushFailedPurchasesCachedAsPending;\n getItemsByType: GetItemsByType;\n getAvailableItemsByType: GetAvailableItemsByType;\n getPurchaseHistoryByType: GetPurchaseHistoryByType;\n buyItemByType: BuyItemByType;\n acknowledgePurchase: AcknowledgePurchase;\n consumeProduct: ConsumeProduct;\n startListening: StartListening;\n getPackageName: GetPackageName;\n}\n\nexport const AndroidModule = NativeModules.RNIapModule as AndroidModuleProps;\n\nexport const getInstallSourceAndroid = (): InstallSourceAndroid => {\n return RNIapModule\n ? InstallSourceAndroid.GOOGLE_PLAY\n : InstallSourceAndroid.AMAZON;\n};\n\n/**\n * Deep link to subscriptions screen on Android.\n * @param {string} sku The product's SKU (on Android)\n * @returns {Promise<void>}\n */\nexport const deepLinkToSubscriptionsAndroid = async ({\n sku,\n}: {\n sku: Sku;\n}): Promise<void> => {\n checkNativeAndroidAvailable();\n\n return Linking.openURL(\n `https://play.google.com/store/account/subscriptions?package=${await RNIapModule.getPackageName()}&sku=${sku}`,\n );\n};\n\n/**\n * Validate receipt for Android. NOTE: This method is here for debugging purposes only. Including\n * your access token in the binary you ship to users is potentially dangerous.\n * Use server side validation instead for your production builds\n * @param {string} packageName package name of your app.\n * @param {string} productId product id for your in app product.\n * @param {string} productToken token for your purchase.\n * @param {string} accessToken accessToken from googleApis.\n * @param {boolean} isSub whether this is subscription or inapp. `true` for subscription.\n * @returns {Promise<object>}\n */\nexport const validateReceiptAndroid = async ({\n packageName,\n productId,\n productToken,\n accessToken,\n isSub,\n}: {\n packageName: string;\n productId: string;\n productToken: string;\n accessToken: string;\n isSub?: boolean;\n}): Promise<Android.ReceiptType> => {\n const type = isSub ? 'subscriptions' : 'products';\n\n const url =\n 'https://androidpublisher.googleapis.com/androidpublisher/v3/applications' +\n `/${packageName}/purchases/${type}/${productId}` +\n `/tokens/${productToken}?access_token=${accessToken}`;\n\n const response = await fetch(url, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n },\n });\n\n if (!response.ok) {\n throw Object.assign(new Error(response.statusText), {\n statusCode: response.status,\n });\n }\n\n return response.json();\n};\n\n/**\n * Acknowledge a product (on Android.) No-op on iOS.\n * @param {string} token The product's token (on Android)\n * @returns {Promise<PurchaseResult | void>}\n */\nexport const acknowledgePurchaseAndroid = ({\n token,\n developerPayload,\n}: {\n token: string;\n developerPayload?: string;\n}): Promise<PurchaseResult | boolean | void> => {\n return getAndroidModule().acknowledgePurchase(token, developerPayload);\n};\n"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AAaA,MAAM;EAACA;AAAD,IAAgBC,0BAAtB;
|
|
1
|
+
{"version":3,"names":["RNIapModule","NativeModules","AndroidModule","getInstallSourceAndroid","InstallSourceAndroid","GOOGLE_PLAY","AMAZON","deepLinkToSubscriptionsAndroid","sku","checkNativeAndroidAvailable","Linking","openURL","getPackageName","validateReceiptAndroid","packageName","productId","productToken","accessToken","isSub","type","url","response","fetch","method","headers","ok","Object","assign","Error","statusText","statusCode","status","json","acknowledgePurchaseAndroid","token","developerPayload","getAndroidModule","acknowledgePurchase"],"sources":["android.ts"],"sourcesContent":["import {Linking, NativeModules} from 'react-native';\n\nimport {checkNativeAndroidAvailable, getAndroidModule} from '../internal';\nimport {\n InstallSourceAndroid,\n Product,\n ProductType,\n ProrationModesAndroid,\n Purchase,\n PurchaseResult,\n Sku,\n} from '../types';\nimport type * as Android from '../types/android';\n\nimport type {NativeModuleProps} from './common';\n\nconst {RNIapModule} = NativeModules;\n\ntype FlushFailedPurchasesCachedAsPending = () => Promise<boolean>;\n\ntype GetItemsByType = <T = Product>(\n type: ProductType,\n skus: Sku[],\n) => Promise<T[]>;\n\ntype GetAvailableItemsByType = <T = Purchase>(\n type: ProductType,\n) => Promise<T[]>;\n\ntype GetPurchaseHistoryByType = <T = Purchase>(\n type: ProductType,\n) => Promise<T[]>;\n\nexport type BuyItemByType = (\n type: string,\n skus: Sku[],\n purchaseToken: string | undefined,\n prorationMode: ProrationModesAndroid | -1,\n obfuscatedAccountId: string | undefined,\n obfuscatedProfileId: string | undefined,\n subscriptionOffers: string[],\n isOfferPersonalized: boolean,\n) => Promise<Purchase>;\n\ntype AcknowledgePurchase = (\n purchaseToken: string,\n developerPayloadAndroid?: string,\n) => Promise<PurchaseResult | boolean>;\n\ntype ConsumeProduct = (\n purchaseToken: string,\n developerPayloadAndroid?: string,\n) => Promise<PurchaseResult | boolean>;\n\ntype StartListening = () => Promise<void>;\ntype GetPackageName = () => Promise<string>;\n\nexport interface AndroidModuleProps extends NativeModuleProps {\n flushFailedPurchasesCachedAsPending: FlushFailedPurchasesCachedAsPending;\n getItemsByType: GetItemsByType;\n getAvailableItemsByType: GetAvailableItemsByType;\n getPurchaseHistoryByType: GetPurchaseHistoryByType;\n buyItemByType: BuyItemByType;\n acknowledgePurchase: AcknowledgePurchase;\n consumeProduct: ConsumeProduct;\n /** @deprecated to be renamed to sendUnconsumedPurchases if not removed completely */\n startListening: StartListening;\n getPackageName: GetPackageName;\n}\n\nexport const AndroidModule = NativeModules.RNIapModule as AndroidModuleProps;\n\nexport const getInstallSourceAndroid = (): InstallSourceAndroid => {\n return RNIapModule\n ? InstallSourceAndroid.GOOGLE_PLAY\n : InstallSourceAndroid.AMAZON;\n};\n\n/**\n * Deep link to subscriptions screen on Android.\n * @param {string} sku The product's SKU (on Android)\n * @returns {Promise<void>}\n */\nexport const deepLinkToSubscriptionsAndroid = async ({\n sku,\n}: {\n sku: Sku;\n}): Promise<void> => {\n checkNativeAndroidAvailable();\n\n return Linking.openURL(\n `https://play.google.com/store/account/subscriptions?package=${await RNIapModule.getPackageName()}&sku=${sku}`,\n );\n};\n\n/**\n * Validate receipt for Android. NOTE: This method is here for debugging purposes only. Including\n * your access token in the binary you ship to users is potentially dangerous.\n * Use server side validation instead for your production builds\n * @param {string} packageName package name of your app.\n * @param {string} productId product id for your in app product.\n * @param {string} productToken token for your purchase.\n * @param {string} accessToken accessToken from googleApis.\n * @param {boolean} isSub whether this is subscription or inapp. `true` for subscription.\n * @returns {Promise<object>}\n */\nexport const validateReceiptAndroid = async ({\n packageName,\n productId,\n productToken,\n accessToken,\n isSub,\n}: {\n packageName: string;\n productId: string;\n productToken: string;\n accessToken: string;\n isSub?: boolean;\n}): Promise<Android.ReceiptType> => {\n const type = isSub ? 'subscriptions' : 'products';\n\n const url =\n 'https://androidpublisher.googleapis.com/androidpublisher/v3/applications' +\n `/${packageName}/purchases/${type}/${productId}` +\n `/tokens/${productToken}?access_token=${accessToken}`;\n\n const response = await fetch(url, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n },\n });\n\n if (!response.ok) {\n throw Object.assign(new Error(response.statusText), {\n statusCode: response.status,\n });\n }\n\n return response.json();\n};\n\n/**\n * Acknowledge a product (on Android.) No-op on iOS.\n * @param {string} token The product's token (on Android)\n * @returns {Promise<PurchaseResult | void>}\n */\nexport const acknowledgePurchaseAndroid = ({\n token,\n developerPayload,\n}: {\n token: string;\n developerPayload?: string;\n}): Promise<PurchaseResult | boolean | void> => {\n return getAndroidModule().acknowledgePurchase(token, developerPayload);\n};\n"],"mappings":";;;;;;;AAAA;;AAEA;;AACA;;AAaA,MAAM;EAACA;AAAD,IAAgBC,0BAAtB;AAsDO,MAAMC,aAAa,GAAGD,0BAAA,CAAcD,WAApC;;;AAEA,MAAMG,uBAAuB,GAAG,MAA4B;EACjE,OAAOH,WAAW,GACdI,2BAAA,CAAqBC,WADP,GAEdD,2BAAA,CAAqBE,MAFzB;AAGD,CAJM;AAMP;AACA;AACA;AACA;AACA;;;;;AACO,MAAMC,8BAA8B,GAAG,cAIzB;EAAA,IAJgC;IACnDC;EADmD,CAIhC;EACnB,IAAAC,qCAAA;EAEA,OAAOC,oBAAA,CAAQC,OAAR,CACJ,+DAA8D,MAAMX,WAAW,CAACY,cAAZ,EAA6B,QAAOJ,GAAI,EADxG,CAAP;AAGD,CAVM;AAYP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AACO,MAAMK,sBAAsB,GAAG,eAYF;EAAA,IAZS;IAC3CC,WAD2C;IAE3CC,SAF2C;IAG3CC,YAH2C;IAI3CC,WAJ2C;IAK3CC;EAL2C,CAYT;EAClC,MAAMC,IAAI,GAAGD,KAAK,GAAG,eAAH,GAAqB,UAAvC;EAEA,MAAME,GAAG,GACP,6EACC,IAAGN,WAAY,cAAaK,IAAK,IAAGJ,SAAU,EAD/C,GAEC,WAAUC,YAAa,iBAAgBC,WAAY,EAHtD;EAKA,MAAMI,QAAQ,GAAG,MAAMC,KAAK,CAACF,GAAD,EAAM;IAChCG,MAAM,EAAE,KADwB;IAEhCC,OAAO,EAAE;MACP,gBAAgB;IADT;EAFuB,CAAN,CAA5B;;EAOA,IAAI,CAACH,QAAQ,CAACI,EAAd,EAAkB;IAChB,MAAMC,MAAM,CAACC,MAAP,CAAc,IAAIC,KAAJ,CAAUP,QAAQ,CAACQ,UAAnB,CAAd,EAA8C;MAClDC,UAAU,EAAET,QAAQ,CAACU;IAD6B,CAA9C,CAAN;EAGD;;EAED,OAAOV,QAAQ,CAACW,IAAT,EAAP;AACD,CAlCM;AAoCP;AACA;AACA;AACA;AACA;;;;;AACO,MAAMC,0BAA0B,GAAG,SAMM;EAAA,IANL;IACzCC,KADyC;IAEzCC;EAFyC,CAMK;EAC9C,OAAO,IAAAC,0BAAA,IAAmBC,mBAAnB,CAAuCH,KAAvC,EAA8CC,gBAA9C,CAAP;AACD,CARM"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { NativeEventEmitter } from 'react-native';
|
|
2
2
|
import { transactionSk2ToPurchaseMap } from './types/appleSk2';
|
|
3
3
|
import { isIosStorekit2 } from './iap';
|
|
4
|
-
import {
|
|
4
|
+
import { getIosModule, getNativeModule, isIos } from './internal';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Add IAP purchase event
|
|
@@ -41,11 +41,6 @@ export const purchaseUpdatedListener = listener => {
|
|
|
41
41
|
listener(transactionSk2ToPurchaseMap(event));
|
|
42
42
|
} : listener;
|
|
43
43
|
const emitterSubscription = eventEmitter.addListener('purchase-updated', proxyListener);
|
|
44
|
-
|
|
45
|
-
if (isAndroid) {
|
|
46
|
-
getAndroidModule().startListening();
|
|
47
|
-
}
|
|
48
|
-
|
|
49
44
|
return emitterSubscription;
|
|
50
45
|
};
|
|
51
46
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeEventEmitter","transactionSk2ToPurchaseMap","isIosStorekit2","
|
|
1
|
+
{"version":3,"names":["NativeEventEmitter","transactionSk2ToPurchaseMap","isIosStorekit2","getIosModule","getNativeModule","isIos","purchaseUpdatedListener","listener","eventEmitter","proxyListener","event","emitterSubscription","addListener","purchaseErrorListener","promotedProductListener","transactionListener"],"sources":["eventEmitter.ts"],"sourcesContent":["import {EmitterSubscription, NativeEventEmitter} from 'react-native';\n\nimport {TransactionEvent, transactionSk2ToPurchaseMap} from './types/appleSk2';\nimport {isIosStorekit2} from './iap';\nimport {getIosModule, getNativeModule, isIos} from './internal';\nimport type {PurchaseError} from './purchaseError';\nimport type {Purchase} from './types';\n\n/**\n * Add IAP purchase event\n * Register a callback that gets called when the store has any updates to purchases that have not yet been finished, consumed or acknowledged. Returns a React Native `EmitterSubscription` on which you can call `.remove()` to stop receiving updates. Register you listener as soon as possible and react to updates at all times.\n\n## Signature\n\n```ts\npurchaseUpdatedListener((purchase: Purchase) => {});\n```\n\n## Usage\n\n```tsx\nimport React, {useEffect} from 'react';\nimport {View} from 'react-native';\nimport {purchaseUpdatedListener} from 'react-native-iap';\n\nconst App = () => {\n useEffect(() => {\n const subscription = purchaseUpdatedListener((purchase: Purchase) => {\n console.log(purchase);\n });\n\n return () => {\n subscription.remove();\n };\n }, []);\n\n return <View />;\n};\n```\n */\nexport const purchaseUpdatedListener = (\n listener: (event: Purchase) => void,\n) => {\n const eventEmitter = new NativeEventEmitter(getNativeModule());\n const proxyListener = isIosStorekit2()\n ? (event: Purchase) => {\n listener(transactionSk2ToPurchaseMap(event as any));\n }\n : listener;\n const emitterSubscription = eventEmitter.addListener(\n 'purchase-updated',\n proxyListener,\n );\n\n return emitterSubscription;\n};\n\n/**\n * Add IAP purchase error event\n * Register a callback that gets called when there has been an error with a purchase. Returns a React Native `EmitterSubscription` on which you can call `.remove()` to stop receiving updates.\n\n## Signature\n\n```ts\npurchaseErrorListener((error: PurchaseError) => {});\n```\n\n## Usage\n\n```tsx\nimport React, {useEffect} from 'react';\nimport {View} from 'react-native';\nimport {purchaseErrorListener} from 'react-native-iap';\n\nconst App = () => {\n useEffect(() => {\n const subscription = purchaseErrorListener((error: PurchaseError) => {\n console.log(error);\n });\n\n return () => {\n subscription.remove();\n };\n }, []);\n\n return <View />;\n};\n```\n\n */\nexport const purchaseErrorListener = (\n listener: (error: PurchaseError) => void,\n): EmitterSubscription => {\n const eventEmitter = new NativeEventEmitter(getNativeModule());\n return eventEmitter.addListener('purchase-error', listener);\n};\n\n/**\n * Add IAP promoted subscription event\n * Add IAP promoted subscription event.\n\n## Signature\n\n```ts\npromotedProductListener((productId?: string) => {});\n```\n\n## Usage\n\n```tsx\nimport React, {useEffect} from 'react';\nimport {View} from 'react-native';\nimport {promotedProductListener} from 'react-native-iap';\n\nconst App = () => {\n useEffect(() => {\n const subscription = promotedProductListener((productId) => {\n console.log(productId);\n });\n\n return () => {\n subscription.remove();\n };\n }, []);\n\n return <View />;\n};\n```\n\n *\n * @platform iOS\n */\nexport const promotedProductListener = (listener: () => void) => {\n if (isIos && !isIosStorekit2()) {\n const eventEmitter = new NativeEventEmitter(getIosModule());\n return eventEmitter.addListener('iap-promoted-product', listener);\n }\n\n return null;\n};\n\n/**\n * Updated transactions for iOS Sk2\n * Register a callback that gets called when the store has any updates to transactions related to purchases that have not yet been finished, consumed or acknowledged. \n * Returns a React Native `EmitterSubscription` on which you can call `.remove()` to stop receiving updates. Register you listener as soon as possible and react to updates at all times.\n\n**Warning**\nThis is only available for iOS 15 and higher and Storekit 2 is activated\n\n## Signature\n\n```ts\npurchaseUpdatedListener((transactionOrError: TransactionOrError) => {});\n```\n\n## Usage\n\n```tsx\nimport React, {useEffect} from 'react';\nimport {View} from 'react-native';\nimport {purchaseUpdatedListener} from 'react-native-iap';\n\nconst App = () => {\n useEffect(() => {\n const subscription = purchaseUpdatedListener((transactionOrError: TransactionOrError) => {\n if(transactionOrError.transaction){\n console.log(\"There's an update to a transaction\", transactionOrError.transaction);\n }else{\n console.log(\"There's been an error with a received transaction\")\n }\n });\n\n return () => {\n subscription.remove();\n };\n }, []);\n\n return <View />;\n};\n```\n *\n * @platform iOS (Sk2)\n */\nexport const transactionListener = (\n listener: (event: TransactionEvent) => void,\n) => {\n if (isIos && isIosStorekit2()) {\n const eventEmitter = new NativeEventEmitter(getIosModule());\n return eventEmitter.addListener('iap-transaction-updated', listener);\n }\n\n return null;\n};\n"],"mappings":"AAAA,SAA6BA,kBAA7B,QAAsD,cAAtD;AAEA,SAA0BC,2BAA1B,QAA4D,kBAA5D;AACA,SAAQC,cAAR,QAA6B,OAA7B;AACA,SAAQC,YAAR,EAAsBC,eAAtB,EAAuCC,KAAvC,QAAmD,YAAnD;;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,uBAAuB,GAClCC,QADqC,IAElC;EACH,MAAMC,YAAY,GAAG,IAAIR,kBAAJ,CAAuBI,eAAe,EAAtC,CAArB;EACA,MAAMK,aAAa,GAAGP,cAAc,KAC/BQ,KAAD,IAAqB;IACnBH,QAAQ,CAACN,2BAA2B,CAACS,KAAD,CAA5B,CAAR;EACD,CAH+B,GAIhCH,QAJJ;EAKA,MAAMI,mBAAmB,GAAGH,YAAY,CAACI,WAAb,CAC1B,kBAD0B,EAE1BH,aAF0B,CAA5B;EAKA,OAAOE,mBAAP;AACD,CAfM;AAiBP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAME,qBAAqB,GAChCN,QADmC,IAEX;EACxB,MAAMC,YAAY,GAAG,IAAIR,kBAAJ,CAAuBI,eAAe,EAAtC,CAArB;EACA,OAAOI,YAAY,CAACI,WAAb,CAAyB,gBAAzB,EAA2CL,QAA3C,CAAP;AACD,CALM;AAOP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMO,uBAAuB,GAAIP,QAAD,IAA0B;EAC/D,IAAIF,KAAK,IAAI,CAACH,cAAc,EAA5B,EAAgC;IAC9B,MAAMM,YAAY,GAAG,IAAIR,kBAAJ,CAAuBG,YAAY,EAAnC,CAArB;IACA,OAAOK,YAAY,CAACI,WAAb,CAAyB,sBAAzB,EAAiDL,QAAjD,CAAP;EACD;;EAED,OAAO,IAAP;AACD,CAPM;AASP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMQ,mBAAmB,GAC9BR,QADiC,IAE9B;EACH,IAAIF,KAAK,IAAIH,cAAc,EAA3B,EAA+B;IAC7B,MAAMM,YAAY,GAAG,IAAIR,kBAAJ,CAAuBG,YAAY,EAAnC,CAArB;IACA,OAAOK,YAAY,CAACI,WAAb,CAAyB,yBAAzB,EAAoDL,QAApD,CAAP;EACD;;EAED,OAAO,IAAP;AACD,CATM"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeModules","enhancedFetch","AmazonModule","RNIapAmazonModule","validateReceiptAmazon","developerSecret","userId","receiptId","useSandbox","sandBoxUrl","url","verifyLicense","deepLinkToSubscriptionsAmazon","isAmazonDevice","deepLinkToSubscriptions"],"sources":["amazon.ts"],"sourcesContent":["import {NativeModules} from 'react-native';\n\nimport {enhancedFetch} from '../internal';\nimport type {Product, Purchase, Sku} from '../types';\nimport type {\n AmazonLicensingStatus,\n ReceiptType,\n UserDataAmazon,\n} from '../types/amazon';\n\nimport type {NativeModuleProps} from './common';\n// ----------\n\ntype GetUser = () => Promise<UserDataAmazon>;\ntype FlushFailedPurchasesCachedAsPending = () => Promise<boolean>;\ntype GetItemsByType = (type: string, skus: Sku[]) => Promise<Product[]>;\ntype GetAvailableItems = () => Promise<Purchase[]>;\ntype BuyItemByType = (sku: Sku) => Promise<Purchase>;\n\ntype AcknowledgePurchase = (\n purchaseToken: string,\n developerPayloadAndroid?: string,\n) => Promise<boolean>;\n\ntype ConsumeProduct = (\n purchaseToken: string,\n developerPayloadAndroid?: string,\n) => Promise<boolean>;\n\ntype StartListening = () => Promise<void>;\n\nexport interface AmazonModuleProps extends NativeModuleProps {\n getUser: GetUser;\n flushFailedPurchasesCachedAsPending: FlushFailedPurchasesCachedAsPending;\n getItemsByType: GetItemsByType;\n getAvailableItems: GetAvailableItems;\n buyItemByType: BuyItemByType;\n acknowledgePurchase: AcknowledgePurchase;\n consumeProduct: ConsumeProduct;\n startListening: StartListening;\n verifyLicense: () => Promise<AmazonLicensingStatus>;\n deepLinkToSubscriptions: (isAmazonDevice: boolean) => Promise<void>;\n}\n\nexport const AmazonModule =\n NativeModules.RNIapAmazonModule as AmazonModuleProps;\n\n/**\n * Validate receipt for Amazon. NOTE: This method is here for debugging purposes only. Including\n * your developer secret in the binary you ship to users is potentially dangerous.\n * Use server side validation instead for your production builds\n * @param {string} developerSecret: from the Amazon developer console.\n * @param {string} userId who purchased the item.\n * @param {string} receiptId long obfuscated string returned when purchasing the item\n * @param {boolean} useSandbox Defaults to true, use sandbox environment or production.\n * @returns {Promise<object>}\n */\nexport const validateReceiptAmazon = async ({\n developerSecret,\n userId,\n receiptId,\n useSandbox = true,\n}: {\n developerSecret: string;\n userId: string;\n receiptId: string;\n useSandbox: boolean;\n}): Promise<ReceiptType> => {\n const sandBoxUrl = useSandbox ? 'sandbox/' : '';\n const url = `https://appstore-sdk.amazon.com/${sandBoxUrl}version/1.0/verifyReceiptId/developer/${developerSecret}/user/${userId}/receiptId/${receiptId}`;\n\n return await enhancedFetch<ReceiptType>(url);\n};\n\n/**\n * Returns the status of verifying app's license @see AmazonLicensingStatus\n */\nexport const verifyLicense = async (): Promise<AmazonLicensingStatus> =>\n AmazonModule.verifyLicense();\n\n/**\n * Deep link to subscriptions screen on Android.\n * @param {string} sku The product's SKU (on Android)\n * @returns {Promise<void>}\n */\nexport const deepLinkToSubscriptionsAmazon = async ({\n isAmazonDevice,\n}: {\n isAmazonDevice: boolean;\n}): Promise<void> => AmazonModule.deepLinkToSubscriptions(isAmazonDevice);\n"],"mappings":"AAAA,SAAQA,aAAR,QAA4B,cAA5B;AAEA,SAAQC,aAAR,QAA4B,aAA5B;
|
|
1
|
+
{"version":3,"names":["NativeModules","enhancedFetch","AmazonModule","RNIapAmazonModule","validateReceiptAmazon","developerSecret","userId","receiptId","useSandbox","sandBoxUrl","url","verifyLicense","deepLinkToSubscriptionsAmazon","isAmazonDevice","deepLinkToSubscriptions"],"sources":["amazon.ts"],"sourcesContent":["import {NativeModules} from 'react-native';\n\nimport {enhancedFetch} from '../internal';\nimport type {Product, Purchase, Sku} from '../types';\nimport type {\n AmazonLicensingStatus,\n ReceiptType,\n UserDataAmazon,\n} from '../types/amazon';\n\nimport type {NativeModuleProps} from './common';\n// ----------\n\ntype GetUser = () => Promise<UserDataAmazon>;\ntype FlushFailedPurchasesCachedAsPending = () => Promise<boolean>;\ntype GetItemsByType = (type: string, skus: Sku[]) => Promise<Product[]>;\ntype GetAvailableItems = () => Promise<Purchase[]>;\ntype BuyItemByType = (sku: Sku) => Promise<Purchase>;\n\ntype AcknowledgePurchase = (\n purchaseToken: string,\n developerPayloadAndroid?: string,\n) => Promise<boolean>;\n\ntype ConsumeProduct = (\n purchaseToken: string,\n developerPayloadAndroid?: string,\n) => Promise<boolean>;\n\ntype StartListening = () => Promise<void>;\n\nexport interface AmazonModuleProps extends NativeModuleProps {\n getUser: GetUser;\n flushFailedPurchasesCachedAsPending: FlushFailedPurchasesCachedAsPending;\n getItemsByType: GetItemsByType;\n getAvailableItems: GetAvailableItems;\n buyItemByType: BuyItemByType;\n acknowledgePurchase: AcknowledgePurchase;\n consumeProduct: ConsumeProduct;\n /** @deprecated to be renamed to sendUnconsumedPurchases if not removed completely */\n startListening: StartListening;\n verifyLicense: () => Promise<AmazonLicensingStatus>;\n deepLinkToSubscriptions: (isAmazonDevice: boolean) => Promise<void>;\n}\n\nexport const AmazonModule =\n NativeModules.RNIapAmazonModule as AmazonModuleProps;\n\n/**\n * Validate receipt for Amazon. NOTE: This method is here for debugging purposes only. Including\n * your developer secret in the binary you ship to users is potentially dangerous.\n * Use server side validation instead for your production builds\n * @param {string} developerSecret: from the Amazon developer console.\n * @param {string} userId who purchased the item.\n * @param {string} receiptId long obfuscated string returned when purchasing the item\n * @param {boolean} useSandbox Defaults to true, use sandbox environment or production.\n * @returns {Promise<object>}\n */\nexport const validateReceiptAmazon = async ({\n developerSecret,\n userId,\n receiptId,\n useSandbox = true,\n}: {\n developerSecret: string;\n userId: string;\n receiptId: string;\n useSandbox: boolean;\n}): Promise<ReceiptType> => {\n const sandBoxUrl = useSandbox ? 'sandbox/' : '';\n const url = `https://appstore-sdk.amazon.com/${sandBoxUrl}version/1.0/verifyReceiptId/developer/${developerSecret}/user/${userId}/receiptId/${receiptId}`;\n\n return await enhancedFetch<ReceiptType>(url);\n};\n\n/**\n * Returns the status of verifying app's license @see AmazonLicensingStatus\n */\nexport const verifyLicense = async (): Promise<AmazonLicensingStatus> =>\n AmazonModule.verifyLicense();\n\n/**\n * Deep link to subscriptions screen on Android.\n * @param {string} sku The product's SKU (on Android)\n * @returns {Promise<void>}\n */\nexport const deepLinkToSubscriptionsAmazon = async ({\n isAmazonDevice,\n}: {\n isAmazonDevice: boolean;\n}): Promise<void> => AmazonModule.deepLinkToSubscriptions(isAmazonDevice);\n"],"mappings":"AAAA,SAAQA,aAAR,QAA4B,cAA5B;AAEA,SAAQC,aAAR,QAA4B,aAA5B;AA2CA,OAAO,MAAMC,YAAY,GACvBF,aAAa,CAACG,iBADT;AAGP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,qBAAqB,GAAG,cAUT;EAAA,IAVgB;IAC1CC,eAD0C;IAE1CC,MAF0C;IAG1CC,SAH0C;IAI1CC,UAAU,GAAG;EAJ6B,CAUhB;EAC1B,MAAMC,UAAU,GAAGD,UAAU,GAAG,UAAH,GAAgB,EAA7C;EACA,MAAME,GAAG,GAAI,mCAAkCD,UAAW,yCAAwCJ,eAAgB,SAAQC,MAAO,cAAaC,SAAU,EAAxJ;EAEA,OAAO,MAAMN,aAAa,CAAcS,GAAd,CAA1B;AACD,CAfM;AAiBP;AACA;AACA;;AACA,OAAO,MAAMC,aAAa,GAAG,YAC3BT,YAAY,CAACS,aAAb,EADK;AAGP;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,6BAA6B,GAAG;EAAA,IAAO;IAClDC;EADkD,CAAP;EAAA,OAIxBX,YAAY,CAACY,uBAAb,CAAqCD,cAArC,CAJwB;AAAA,CAAtC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Linking","NativeModules","checkNativeAndroidAvailable","getAndroidModule","InstallSourceAndroid","RNIapModule","AndroidModule","getInstallSourceAndroid","GOOGLE_PLAY","AMAZON","deepLinkToSubscriptionsAndroid","sku","openURL","getPackageName","validateReceiptAndroid","packageName","productId","productToken","accessToken","isSub","type","url","response","fetch","method","headers","ok","Object","assign","Error","statusText","statusCode","status","json","acknowledgePurchaseAndroid","token","developerPayload","acknowledgePurchase"],"sources":["android.ts"],"sourcesContent":["import {Linking, NativeModules} from 'react-native';\n\nimport {checkNativeAndroidAvailable, getAndroidModule} from '../internal';\nimport {\n InstallSourceAndroid,\n Product,\n ProductType,\n ProrationModesAndroid,\n Purchase,\n PurchaseResult,\n Sku,\n} from '../types';\nimport type * as Android from '../types/android';\n\nimport type {NativeModuleProps} from './common';\n\nconst {RNIapModule} = NativeModules;\n\ntype FlushFailedPurchasesCachedAsPending = () => Promise<boolean>;\n\ntype GetItemsByType = <T = Product>(\n type: ProductType,\n skus: Sku[],\n) => Promise<T[]>;\n\ntype GetAvailableItemsByType = <T = Purchase>(\n type: ProductType,\n) => Promise<T[]>;\n\ntype GetPurchaseHistoryByType = <T = Purchase>(\n type: ProductType,\n) => Promise<T[]>;\n\nexport type BuyItemByType = (\n type: string,\n skus: Sku[],\n purchaseToken: string | undefined,\n prorationMode: ProrationModesAndroid | -1,\n obfuscatedAccountId: string | undefined,\n obfuscatedProfileId: string | undefined,\n subscriptionOffers: string[],\n isOfferPersonalized: boolean,\n) => Promise<Purchase>;\n\ntype AcknowledgePurchase = (\n purchaseToken: string,\n developerPayloadAndroid?: string,\n) => Promise<PurchaseResult | boolean>;\n\ntype ConsumeProduct = (\n purchaseToken: string,\n developerPayloadAndroid?: string,\n) => Promise<PurchaseResult | boolean>;\n\ntype StartListening = () => Promise<void>;\ntype GetPackageName = () => Promise<string>;\n\nexport interface AndroidModuleProps extends NativeModuleProps {\n flushFailedPurchasesCachedAsPending: FlushFailedPurchasesCachedAsPending;\n getItemsByType: GetItemsByType;\n getAvailableItemsByType: GetAvailableItemsByType;\n getPurchaseHistoryByType: GetPurchaseHistoryByType;\n buyItemByType: BuyItemByType;\n acknowledgePurchase: AcknowledgePurchase;\n consumeProduct: ConsumeProduct;\n startListening: StartListening;\n getPackageName: GetPackageName;\n}\n\nexport const AndroidModule = NativeModules.RNIapModule as AndroidModuleProps;\n\nexport const getInstallSourceAndroid = (): InstallSourceAndroid => {\n return RNIapModule\n ? InstallSourceAndroid.GOOGLE_PLAY\n : InstallSourceAndroid.AMAZON;\n};\n\n/**\n * Deep link to subscriptions screen on Android.\n * @param {string} sku The product's SKU (on Android)\n * @returns {Promise<void>}\n */\nexport const deepLinkToSubscriptionsAndroid = async ({\n sku,\n}: {\n sku: Sku;\n}): Promise<void> => {\n checkNativeAndroidAvailable();\n\n return Linking.openURL(\n `https://play.google.com/store/account/subscriptions?package=${await RNIapModule.getPackageName()}&sku=${sku}`,\n );\n};\n\n/**\n * Validate receipt for Android. NOTE: This method is here for debugging purposes only. Including\n * your access token in the binary you ship to users is potentially dangerous.\n * Use server side validation instead for your production builds\n * @param {string} packageName package name of your app.\n * @param {string} productId product id for your in app product.\n * @param {string} productToken token for your purchase.\n * @param {string} accessToken accessToken from googleApis.\n * @param {boolean} isSub whether this is subscription or inapp. `true` for subscription.\n * @returns {Promise<object>}\n */\nexport const validateReceiptAndroid = async ({\n packageName,\n productId,\n productToken,\n accessToken,\n isSub,\n}: {\n packageName: string;\n productId: string;\n productToken: string;\n accessToken: string;\n isSub?: boolean;\n}): Promise<Android.ReceiptType> => {\n const type = isSub ? 'subscriptions' : 'products';\n\n const url =\n 'https://androidpublisher.googleapis.com/androidpublisher/v3/applications' +\n `/${packageName}/purchases/${type}/${productId}` +\n `/tokens/${productToken}?access_token=${accessToken}`;\n\n const response = await fetch(url, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n },\n });\n\n if (!response.ok) {\n throw Object.assign(new Error(response.statusText), {\n statusCode: response.status,\n });\n }\n\n return response.json();\n};\n\n/**\n * Acknowledge a product (on Android.) No-op on iOS.\n * @param {string} token The product's token (on Android)\n * @returns {Promise<PurchaseResult | void>}\n */\nexport const acknowledgePurchaseAndroid = ({\n token,\n developerPayload,\n}: {\n token: string;\n developerPayload?: string;\n}): Promise<PurchaseResult | boolean | void> => {\n return getAndroidModule().acknowledgePurchase(token, developerPayload);\n};\n"],"mappings":"AAAA,SAAQA,OAAR,EAAiBC,aAAjB,QAAqC,cAArC;AAEA,SAAQC,2BAAR,EAAqCC,gBAArC,QAA4D,aAA5D;AACA,SACEC,oBADF,QAQO,UARP;AAaA,MAAM;EAACC;AAAD,IAAgBJ,aAAtB;
|
|
1
|
+
{"version":3,"names":["Linking","NativeModules","checkNativeAndroidAvailable","getAndroidModule","InstallSourceAndroid","RNIapModule","AndroidModule","getInstallSourceAndroid","GOOGLE_PLAY","AMAZON","deepLinkToSubscriptionsAndroid","sku","openURL","getPackageName","validateReceiptAndroid","packageName","productId","productToken","accessToken","isSub","type","url","response","fetch","method","headers","ok","Object","assign","Error","statusText","statusCode","status","json","acknowledgePurchaseAndroid","token","developerPayload","acknowledgePurchase"],"sources":["android.ts"],"sourcesContent":["import {Linking, NativeModules} from 'react-native';\n\nimport {checkNativeAndroidAvailable, getAndroidModule} from '../internal';\nimport {\n InstallSourceAndroid,\n Product,\n ProductType,\n ProrationModesAndroid,\n Purchase,\n PurchaseResult,\n Sku,\n} from '../types';\nimport type * as Android from '../types/android';\n\nimport type {NativeModuleProps} from './common';\n\nconst {RNIapModule} = NativeModules;\n\ntype FlushFailedPurchasesCachedAsPending = () => Promise<boolean>;\n\ntype GetItemsByType = <T = Product>(\n type: ProductType,\n skus: Sku[],\n) => Promise<T[]>;\n\ntype GetAvailableItemsByType = <T = Purchase>(\n type: ProductType,\n) => Promise<T[]>;\n\ntype GetPurchaseHistoryByType = <T = Purchase>(\n type: ProductType,\n) => Promise<T[]>;\n\nexport type BuyItemByType = (\n type: string,\n skus: Sku[],\n purchaseToken: string | undefined,\n prorationMode: ProrationModesAndroid | -1,\n obfuscatedAccountId: string | undefined,\n obfuscatedProfileId: string | undefined,\n subscriptionOffers: string[],\n isOfferPersonalized: boolean,\n) => Promise<Purchase>;\n\ntype AcknowledgePurchase = (\n purchaseToken: string,\n developerPayloadAndroid?: string,\n) => Promise<PurchaseResult | boolean>;\n\ntype ConsumeProduct = (\n purchaseToken: string,\n developerPayloadAndroid?: string,\n) => Promise<PurchaseResult | boolean>;\n\ntype StartListening = () => Promise<void>;\ntype GetPackageName = () => Promise<string>;\n\nexport interface AndroidModuleProps extends NativeModuleProps {\n flushFailedPurchasesCachedAsPending: FlushFailedPurchasesCachedAsPending;\n getItemsByType: GetItemsByType;\n getAvailableItemsByType: GetAvailableItemsByType;\n getPurchaseHistoryByType: GetPurchaseHistoryByType;\n buyItemByType: BuyItemByType;\n acknowledgePurchase: AcknowledgePurchase;\n consumeProduct: ConsumeProduct;\n /** @deprecated to be renamed to sendUnconsumedPurchases if not removed completely */\n startListening: StartListening;\n getPackageName: GetPackageName;\n}\n\nexport const AndroidModule = NativeModules.RNIapModule as AndroidModuleProps;\n\nexport const getInstallSourceAndroid = (): InstallSourceAndroid => {\n return RNIapModule\n ? InstallSourceAndroid.GOOGLE_PLAY\n : InstallSourceAndroid.AMAZON;\n};\n\n/**\n * Deep link to subscriptions screen on Android.\n * @param {string} sku The product's SKU (on Android)\n * @returns {Promise<void>}\n */\nexport const deepLinkToSubscriptionsAndroid = async ({\n sku,\n}: {\n sku: Sku;\n}): Promise<void> => {\n checkNativeAndroidAvailable();\n\n return Linking.openURL(\n `https://play.google.com/store/account/subscriptions?package=${await RNIapModule.getPackageName()}&sku=${sku}`,\n );\n};\n\n/**\n * Validate receipt for Android. NOTE: This method is here for debugging purposes only. Including\n * your access token in the binary you ship to users is potentially dangerous.\n * Use server side validation instead for your production builds\n * @param {string} packageName package name of your app.\n * @param {string} productId product id for your in app product.\n * @param {string} productToken token for your purchase.\n * @param {string} accessToken accessToken from googleApis.\n * @param {boolean} isSub whether this is subscription or inapp. `true` for subscription.\n * @returns {Promise<object>}\n */\nexport const validateReceiptAndroid = async ({\n packageName,\n productId,\n productToken,\n accessToken,\n isSub,\n}: {\n packageName: string;\n productId: string;\n productToken: string;\n accessToken: string;\n isSub?: boolean;\n}): Promise<Android.ReceiptType> => {\n const type = isSub ? 'subscriptions' : 'products';\n\n const url =\n 'https://androidpublisher.googleapis.com/androidpublisher/v3/applications' +\n `/${packageName}/purchases/${type}/${productId}` +\n `/tokens/${productToken}?access_token=${accessToken}`;\n\n const response = await fetch(url, {\n method: 'GET',\n headers: {\n 'Content-Type': 'application/json',\n },\n });\n\n if (!response.ok) {\n throw Object.assign(new Error(response.statusText), {\n statusCode: response.status,\n });\n }\n\n return response.json();\n};\n\n/**\n * Acknowledge a product (on Android.) No-op on iOS.\n * @param {string} token The product's token (on Android)\n * @returns {Promise<PurchaseResult | void>}\n */\nexport const acknowledgePurchaseAndroid = ({\n token,\n developerPayload,\n}: {\n token: string;\n developerPayload?: string;\n}): Promise<PurchaseResult | boolean | void> => {\n return getAndroidModule().acknowledgePurchase(token, developerPayload);\n};\n"],"mappings":"AAAA,SAAQA,OAAR,EAAiBC,aAAjB,QAAqC,cAArC;AAEA,SAAQC,2BAAR,EAAqCC,gBAArC,QAA4D,aAA5D;AACA,SACEC,oBADF,QAQO,UARP;AAaA,MAAM;EAACC;AAAD,IAAgBJ,aAAtB;AAsDA,OAAO,MAAMK,aAAa,GAAGL,aAAa,CAACI,WAApC;AAEP,OAAO,MAAME,uBAAuB,GAAG,MAA4B;EACjE,OAAOF,WAAW,GACdD,oBAAoB,CAACI,WADP,GAEdJ,oBAAoB,CAACK,MAFzB;AAGD,CAJM;AAMP;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,8BAA8B,GAAG,cAIzB;EAAA,IAJgC;IACnDC;EADmD,CAIhC;EACnBT,2BAA2B;EAE3B,OAAOF,OAAO,CAACY,OAAR,CACJ,+DAA8D,MAAMP,WAAW,CAACQ,cAAZ,EAA6B,QAAOF,GAAI,EADxG,CAAP;AAGD,CAVM;AAYP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMG,sBAAsB,GAAG,eAYF;EAAA,IAZS;IAC3CC,WAD2C;IAE3CC,SAF2C;IAG3CC,YAH2C;IAI3CC,WAJ2C;IAK3CC;EAL2C,CAYT;EAClC,MAAMC,IAAI,GAAGD,KAAK,GAAG,eAAH,GAAqB,UAAvC;EAEA,MAAME,GAAG,GACP,6EACC,IAAGN,WAAY,cAAaK,IAAK,IAAGJ,SAAU,EAD/C,GAEC,WAAUC,YAAa,iBAAgBC,WAAY,EAHtD;EAKA,MAAMI,QAAQ,GAAG,MAAMC,KAAK,CAACF,GAAD,EAAM;IAChCG,MAAM,EAAE,KADwB;IAEhCC,OAAO,EAAE;MACP,gBAAgB;IADT;EAFuB,CAAN,CAA5B;;EAOA,IAAI,CAACH,QAAQ,CAACI,EAAd,EAAkB;IAChB,MAAMC,MAAM,CAACC,MAAP,CAAc,IAAIC,KAAJ,CAAUP,QAAQ,CAACQ,UAAnB,CAAd,EAA8C;MAClDC,UAAU,EAAET,QAAQ,CAACU;IAD6B,CAA9C,CAAN;EAGD;;EAED,OAAOV,QAAQ,CAACW,IAAT,EAAP;AACD,CAlCM;AAoCP;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,0BAA0B,GAAG,SAMM;EAAA,IANL;IACzCC,KADyC;IAEzCC;EAFyC,CAMK;EAC9C,OAAOjC,gBAAgB,GAAGkC,mBAAnB,CAAuCF,KAAvC,EAA8CC,gBAA9C,CAAP;AACD,CARM"}
|
|
@@ -17,6 +17,7 @@ export interface AmazonModuleProps extends NativeModuleProps {
|
|
|
17
17
|
buyItemByType: BuyItemByType;
|
|
18
18
|
acknowledgePurchase: AcknowledgePurchase;
|
|
19
19
|
consumeProduct: ConsumeProduct;
|
|
20
|
+
/** @deprecated to be renamed to sendUnconsumedPurchases if not removed completely */
|
|
20
21
|
startListening: StartListening;
|
|
21
22
|
verifyLicense: () => Promise<AmazonLicensingStatus>;
|
|
22
23
|
deepLinkToSubscriptions: (isAmazonDevice: boolean) => Promise<void>;
|
|
@@ -18,6 +18,7 @@ export interface AndroidModuleProps extends NativeModuleProps {
|
|
|
18
18
|
buyItemByType: BuyItemByType;
|
|
19
19
|
acknowledgePurchase: AcknowledgePurchase;
|
|
20
20
|
consumeProduct: ConsumeProduct;
|
|
21
|
+
/** @deprecated to be renamed to sendUnconsumedPurchases if not removed completely */
|
|
21
22
|
startListening: StartListening;
|
|
22
23
|
getPackageName: GetPackageName;
|
|
23
24
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-iap",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.8.1",
|
|
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)",
|
package/src/eventEmitter.ts
CHANGED
|
@@ -2,13 +2,7 @@ import {EmitterSubscription, NativeEventEmitter} from 'react-native';
|
|
|
2
2
|
|
|
3
3
|
import {TransactionEvent, transactionSk2ToPurchaseMap} from './types/appleSk2';
|
|
4
4
|
import {isIosStorekit2} from './iap';
|
|
5
|
-
import {
|
|
6
|
-
getAndroidModule,
|
|
7
|
-
getIosModule,
|
|
8
|
-
getNativeModule,
|
|
9
|
-
isAndroid,
|
|
10
|
-
isIos,
|
|
11
|
-
} from './internal';
|
|
5
|
+
import {getIosModule, getNativeModule, isIos} from './internal';
|
|
12
6
|
import type {PurchaseError} from './purchaseError';
|
|
13
7
|
import type {Purchase} from './types';
|
|
14
8
|
|
|
@@ -58,10 +52,6 @@ export const purchaseUpdatedListener = (
|
|
|
58
52
|
proxyListener,
|
|
59
53
|
);
|
|
60
54
|
|
|
61
|
-
if (isAndroid) {
|
|
62
|
-
getAndroidModule().startListening();
|
|
63
|
-
}
|
|
64
|
-
|
|
65
55
|
return emitterSubscription;
|
|
66
56
|
};
|
|
67
57
|
|
package/src/modules/amazon.ts
CHANGED
|
@@ -37,6 +37,7 @@ export interface AmazonModuleProps extends NativeModuleProps {
|
|
|
37
37
|
buyItemByType: BuyItemByType;
|
|
38
38
|
acknowledgePurchase: AcknowledgePurchase;
|
|
39
39
|
consumeProduct: ConsumeProduct;
|
|
40
|
+
/** @deprecated to be renamed to sendUnconsumedPurchases if not removed completely */
|
|
40
41
|
startListening: StartListening;
|
|
41
42
|
verifyLicense: () => Promise<AmazonLicensingStatus>;
|
|
42
43
|
deepLinkToSubscriptions: (isAmazonDevice: boolean) => Promise<void>;
|
package/src/modules/android.ts
CHANGED
|
@@ -63,6 +63,7 @@ export interface AndroidModuleProps extends NativeModuleProps {
|
|
|
63
63
|
buyItemByType: BuyItemByType;
|
|
64
64
|
acknowledgePurchase: AcknowledgePurchase;
|
|
65
65
|
consumeProduct: ConsumeProduct;
|
|
66
|
+
/** @deprecated to be renamed to sendUnconsumedPurchases if not removed completely */
|
|
66
67
|
startListening: StartListening;
|
|
67
68
|
getPackageName: GetPackageName;
|
|
68
69
|
}
|