expo-iap 2.2.0-rc.3 → 2.2.0-rc.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 (43) hide show
  1. package/build/ExpoIap.types.d.ts +80 -0
  2. package/build/ExpoIap.types.d.ts.map +1 -0
  3. package/build/ExpoIap.types.js +1 -0
  4. package/build/ExpoIap.types.js.map +1 -0
  5. package/build/ExpoIapModule.d.ts +3 -0
  6. package/build/ExpoIapModule.d.ts.map +1 -0
  7. package/build/ExpoIapModule.js +1 -0
  8. package/build/ExpoIapModule.js.map +1 -0
  9. package/build/index.d.ts +37 -0
  10. package/build/index.d.ts.map +1 -0
  11. package/build/index.js +1 -0
  12. package/build/index.js.map +1 -0
  13. package/build/modules/android.d.ts +48 -0
  14. package/build/modules/android.d.ts.map +1 -0
  15. package/build/modules/android.js +1 -0
  16. package/build/modules/android.js.map +1 -0
  17. package/build/modules/ios.d.ts +49 -0
  18. package/build/modules/ios.d.ts.map +1 -0
  19. package/build/modules/ios.js +1 -0
  20. package/build/modules/ios.js.map +1 -0
  21. package/build/types/ExpoIapAndroid.types.d.ts +113 -0
  22. package/build/types/ExpoIapAndroid.types.d.ts.map +1 -0
  23. package/build/types/ExpoIapAndroid.types.js +1 -0
  24. package/build/types/ExpoIapAndroid.types.js.map +1 -0
  25. package/build/types/ExpoIapIos.types.d.ts +118 -0
  26. package/build/types/ExpoIapIos.types.d.ts.map +1 -0
  27. package/build/types/ExpoIapIos.types.js +1 -0
  28. package/build/types/ExpoIapIos.types.js.map +1 -0
  29. package/build/useIap.d.ts +23 -0
  30. package/build/useIap.d.ts.map +1 -0
  31. package/build/useIap.js +1 -0
  32. package/build/useIap.js.map +1 -0
  33. package/iap.md +16 -0
  34. package/package.json +3 -2
  35. package/tsconfig.json +1 -6
  36. package/build/ExpoIap.types.ts +0 -125
  37. package/build/ExpoIapModule.ts +0 -5
  38. package/build/index.ts +0 -354
  39. package/build/modules/android.ts +0 -99
  40. package/build/modules/ios.ts +0 -84
  41. package/build/types/ExpoIapAndroid.types.ts +0 -127
  42. package/build/types/ExpoIapIos.types.ts +0 -136
  43. package/build/useIap.ts +0 -185
@@ -0,0 +1,80 @@
1
+ import { ProductAndroid, ProductPurchaseAndroid, RequestPurchaseAndroidProps, RequestSubscriptionAndroidProps, SubscriptionProductAndroid } from './types/ExpoIapAndroid.types';
2
+ import { ProductIos, ProductPurchaseIos, RequestPurchaseIosProps, RequestSubscriptionIosProps, SubscriptionProductIos } from './types/ExpoIapIos.types';
3
+ export type ChangeEventPayload = {
4
+ value: string;
5
+ };
6
+ /**
7
+ * Base product type with common properties shared between iOS and Android
8
+ */
9
+ export type ProductBase = {
10
+ id: string;
11
+ title: string;
12
+ description: string;
13
+ type: ProductType;
14
+ displayName?: string;
15
+ displayPrice?: string;
16
+ price?: number;
17
+ currency?: string;
18
+ };
19
+ export type IosPlatform = {
20
+ platform: 'ios';
21
+ };
22
+ export type AndroidPlatform = {
23
+ platform: 'android';
24
+ };
25
+ export declare enum ProductType {
26
+ InAppPurchase = "inapp",
27
+ Subscription = "subs"
28
+ }
29
+ export type PurchaseBase = {
30
+ id: string;
31
+ transactionId?: string;
32
+ transactionDate: number;
33
+ transactionReceipt: string;
34
+ purchaseToken?: string;
35
+ };
36
+ export type Product = (ProductAndroid & AndroidPlatform) | (ProductIos & IosPlatform);
37
+ export type ProductPurchase = (ProductPurchaseAndroid & AndroidPlatform) | (ProductPurchaseIos & IosPlatform);
38
+ export type SubscriptionPurchase = (ProductPurchaseAndroid & AndroidPlatform & {
39
+ autoRenewingAndroid: boolean;
40
+ }) | (ProductPurchaseIos & IosPlatform);
41
+ export type Purchase = ProductPurchase | SubscriptionPurchase;
42
+ export type RequestPurchaseProps = RequestPurchaseIosProps | RequestPurchaseAndroidProps;
43
+ export type SubscriptionProduct = (SubscriptionProductAndroid & AndroidPlatform) | (SubscriptionProductIos & IosPlatform);
44
+ export type RequestSubscriptionProps = RequestSubscriptionAndroidProps | RequestSubscriptionIosProps;
45
+ export type PurchaseResult = {
46
+ responseCode?: number;
47
+ debugMessage?: string;
48
+ code?: string;
49
+ message?: string;
50
+ purchaseToken?: string;
51
+ };
52
+ export declare enum ErrorCode {
53
+ E_UNKNOWN = "E_UNKNOWN",
54
+ E_USER_CANCELLED = "E_USER_CANCELLED",
55
+ E_USER_ERROR = "E_USER_ERROR",
56
+ E_ITEM_UNAVAILABLE = "E_ITEM_UNAVAILABLE",
57
+ E_REMOTE_ERROR = "E_REMOTE_ERROR",
58
+ E_NETWORK_ERROR = "E_NETWORK_ERROR",
59
+ E_SERVICE_ERROR = "E_SERVICE_ERROR",
60
+ E_RECEIPT_FAILED = "E_RECEIPT_FAILED",
61
+ E_RECEIPT_FINISHED_FAILED = "E_RECEIPT_FINISHED_FAILED",
62
+ E_NOT_PREPARED = "E_NOT_PREPARED",
63
+ E_NOT_ENDED = "E_NOT_ENDED",
64
+ E_ALREADY_OWNED = "E_ALREADY_OWNED",
65
+ E_DEVELOPER_ERROR = "E_DEVELOPER_ERROR",
66
+ E_BILLING_RESPONSE_JSON_PARSE_ERROR = "E_BILLING_RESPONSE_JSON_PARSE_ERROR",
67
+ E_DEFERRED_PAYMENT = "E_DEFERRED_PAYMENT",
68
+ E_INTERRUPTED = "E_INTERRUPTED",
69
+ E_IAP_NOT_AVAILABLE = "E_IAP_NOT_AVAILABLE"
70
+ }
71
+ export declare class PurchaseError implements Error {
72
+ name: string;
73
+ message: string;
74
+ responseCode?: number | undefined;
75
+ debugMessage?: string | undefined;
76
+ code?: ErrorCode | undefined;
77
+ productId?: string | undefined;
78
+ constructor(name: string, message: string, responseCode?: number | undefined, debugMessage?: string | undefined, code?: ErrorCode | undefined, productId?: string | undefined);
79
+ }
80
+ //# sourceMappingURL=ExpoIap.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpoIap.types.d.ts","sourceRoot":"","sources":["../src/ExpoIap.types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAA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ACZ,OAAO,EAAE,MAAM,EACf,YAAY,CAAC,oBAAQ,EACrB,YAAY,CAAC,oBAAQ,EACrB,IAAI,CAAC,uBAAW,EAChB,SAAS,CAAC,oBAAQ;CAS5B"}
@@ -45,3 +45,4 @@ export class PurchaseError {
45
45
  this.productId = productId;
46
46
  }
47
47
  }
48
+ //# sourceMappingURL=ExpoIap.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpoIap.types.js","sourceRoot":"","sources":["../src/ExpoIap.types.ts"],"names":[],"mappings":"AAqCA,MAAM,CAAN,IAAY,WAGX;AAHD,WAAY,WAAW;IACrB,sCAAuB,CAAA;IACvB,oCAAqB,CAAA;AACvB,CAAC,EAHW,WAAW,KAAX,WAAW,QAGtB;AAgDD,MAAM,CAAN,IAAY,SAkBX;AAlBD,WAAY,SAAS;IACnB,oCAAuB,CAAA;IACvB,kDAAqC,CAAA;IACrC,0CAA6B,CAAA;IAC7B,sDAAyC,CAAA;IACzC,8CAAiC,CAAA;IACjC,gDAAmC,CAAA;IACnC,gDAAmC,CAAA;IACnC,kDAAqC,CAAA;IACrC,oEAAuD,CAAA;IACvD,8CAAiC,CAAA;IACjC,wCAA2B,CAAA;IAC3B,gDAAmC,CAAA;IACnC,oDAAuC,CAAA;IACvC,wFAA2E,CAAA;IAC3E,sDAAyC,CAAA;IACzC,4CAA+B,CAAA;IAC/B,wDAA2C,CAAA;AAC7C,CAAC,EAlBW,SAAS,KAAT,SAAS,QAkBpB;AAED,MAAM,OAAO,aAAa;IAEf;IACA;IACA;IACA;IACA;IACA;IANT,YACS,IAAY,EACZ,OAAe,EACf,YAAqB,EACrB,YAAqB,EACrB,IAAgB,EAChB,SAAkB;QALlB,SAAI,GAAJ,IAAI,CAAQ;QACZ,YAAO,GAAP,OAAO,CAAQ;QACf,iBAAY,GAAZ,YAAY,CAAS;QACrB,iBAAY,GAAZ,YAAY,CAAS;QACrB,SAAI,GAAJ,IAAI,CAAY;QAChB,cAAS,GAAT,SAAS,CAAS;QAEzB,IAAI,CAAC,IAAI,GAAG,2BAA2B,CAAC;QACxC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;CACF","sourcesContent":["import {\n ProductAndroid,\n ProductPurchaseAndroid,\n RequestPurchaseAndroidProps,\n RequestSubscriptionAndroidProps,\n SubscriptionProductAndroid,\n} from './types/ExpoIapAndroid.types';\nimport {\n ProductIos,\n ProductPurchaseIos,\n RequestPurchaseIosProps,\n RequestSubscriptionIosProps,\n SubscriptionProductIos,\n} from './types/ExpoIapIos.types';\n\nexport type ChangeEventPayload = {\n value: string;\n};\n\n/**\n * Base product type with common properties shared between iOS and Android\n */\nexport type ProductBase = {\n id: string;\n title: string;\n description: string;\n type: ProductType;\n displayName?: string;\n displayPrice?: string;\n price?: number;\n currency?: string;\n};\n\n// Define literal platform types for better type discrimination\nexport type IosPlatform = {platform: 'ios'};\nexport type AndroidPlatform = {platform: 'android'};\n\nexport enum ProductType {\n InAppPurchase = 'inapp',\n Subscription = 'subs',\n}\n\n// Common base purchase type\nexport type PurchaseBase = {\n id: string;\n transactionId?: string;\n transactionDate: number;\n transactionReceipt: string;\n purchaseToken?: string;\n};\n\n// Union type for platform-specific product types with proper discriminators\nexport type Product =\n | (ProductAndroid & AndroidPlatform)\n | (ProductIos & IosPlatform);\n\n// Union type for platform-specific purchase types with proper discriminators\nexport type ProductPurchase =\n | (ProductPurchaseAndroid & AndroidPlatform)\n | (ProductPurchaseIos & IosPlatform);\n\n// Union type for platform-specific subscription purchase types with proper discriminators\nexport type SubscriptionPurchase =\n | (ProductPurchaseAndroid & AndroidPlatform & { autoRenewingAndroid: boolean })\n | (ProductPurchaseIos & IosPlatform);\n\nexport type Purchase = ProductPurchase | SubscriptionPurchase;\n\nexport type RequestPurchaseProps =\n | RequestPurchaseIosProps\n | RequestPurchaseAndroidProps;\n\nexport type SubscriptionProduct =\n | (SubscriptionProductAndroid & AndroidPlatform)\n | (SubscriptionProductIos & IosPlatform);\n\nexport type RequestSubscriptionProps =\n | RequestSubscriptionAndroidProps\n | RequestSubscriptionIosProps;\n\nexport type PurchaseResult = {\n responseCode?: number;\n debugMessage?: string;\n code?: string;\n message?: string;\n purchaseToken?: string;\n};\n\nexport 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 = '[expo-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"]}
@@ -0,0 +1,3 @@
1
+ declare const _default: any;
2
+ export default _default;
3
+ //# sourceMappingURL=ExpoIapModule.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpoIapModule.d.ts","sourceRoot":"","sources":["../src/ExpoIapModule.ts"],"names":[],"mappings":";AAIA,wBAA8C"}
@@ -2,3 +2,4 @@ import { requireNativeModule } from 'expo-modules-core';
2
2
  // It loads the native module object from the JSI or falls back to
3
3
  // the bridge module (from NativeModulesProxy) if the remote debugger is on.
4
4
  export default requireNativeModule('ExpoIap');
5
+ //# sourceMappingURL=ExpoIapModule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpoIapModule.js","sourceRoot":"","sources":["../src/ExpoIapModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,mBAAmB,EAAC,MAAM,mBAAmB,CAAC;AAEtD,kEAAkE;AAClE,4EAA4E;AAC5E,eAAe,mBAAmB,CAAC,SAAS,CAAC,CAAC","sourcesContent":["import {requireNativeModule} from 'expo-modules-core';\n\n// It loads the native module object from the JSI or falls back to\n// the bridge module (from NativeModulesProxy) if the remote debugger is on.\nexport default requireNativeModule('ExpoIap');\n"]}
@@ -0,0 +1,37 @@
1
+ import { EventEmitter } from 'expo-modules-core';
2
+ import { Product, ProductPurchase, Purchase, PurchaseError, PurchaseResult, RequestSubscriptionProps, SubscriptionProduct, SubscriptionPurchase } from './ExpoIap.types';
3
+ import { RequestPurchaseAndroidProps } from './types/ExpoIapAndroid.types';
4
+ import { RequestPurchaseIosProps } from './types/ExpoIapIos.types';
5
+ export * from './modules/android';
6
+ export * from './modules/ios';
7
+ export declare const PI: any;
8
+ export declare enum IapEvent {
9
+ PurchaseUpdated = "purchase-updated",
10
+ PurchaseError = "purchase-error",
11
+ TransactionIapUpdated = "iap-transaction-updated"
12
+ }
13
+ export declare function setValueAsync(value: string): Promise<any>;
14
+ export declare const emitter: EventEmitter;
15
+ export declare const purchaseUpdatedListener: (listener: (event: Purchase) => void) => import("expo-modules-core").Subscription;
16
+ export declare const purchaseErrorListener: (listener: (error: PurchaseError) => void) => import("expo-modules-core").Subscription;
17
+ export declare function initConnection(): any;
18
+ export declare const getProducts: (skus: string[]) => Promise<Product[]>;
19
+ export declare const getSubscriptions: (skus: string[]) => Promise<SubscriptionProduct[]>;
20
+ export declare function endConnection(): Promise<boolean>;
21
+ export declare const getPurchaseHistory: ({ alsoPublishToEventListener, onlyIncludeActiveItems, }?: {
22
+ alsoPublishToEventListener?: boolean;
23
+ onlyIncludeActiveItems?: boolean;
24
+ }) => Promise<ProductPurchase[]>;
25
+ export declare const getAvailablePurchases: ({ alsoPublishToEventListener, onlyIncludeActiveItems, }?: {
26
+ alsoPublishToEventListener?: boolean;
27
+ onlyIncludeActiveItems?: boolean;
28
+ }) => Promise<ProductPurchase[]>;
29
+ export declare const requestPurchase: (request: RequestPurchaseIosProps | RequestPurchaseAndroidProps) => Promise<ProductPurchase | ProductPurchase[] | void>;
30
+ export declare const requestSubscription: (request: RequestSubscriptionProps) => Promise<SubscriptionPurchase | SubscriptionPurchase[] | null | void>;
31
+ export declare const finishTransaction: ({ purchase, isConsumable, developerPayloadAndroid, }: {
32
+ purchase: Purchase;
33
+ isConsumable?: boolean;
34
+ developerPayloadAndroid?: string;
35
+ }) => Promise<PurchaseResult | boolean>;
36
+ export * from './useIap';
37
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAqB,YAAY,EAAC,MAAM,mBAAmB,CAAC;AAEnE,OAAO,EACL,OAAO,EACP,eAAe,EAEf,QAAQ,EACR,aAAa,EACb,cAAc,EACd,wBAAwB,EACxB,mBAAmB,EACnB,oBAAoB,EACrB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,2BAA2B,EAE5B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAEL,uBAAuB,EAExB,MAAM,0BAA0B,CAAC;AAOlC,cAAc,mBAAm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AAO,MAAM,iBAAiB,yDAI3B;IACD,QAAQ,EAAE,QAAQ,CAAC;IACnB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,uBAAuB,CAAC,EAAE,MAAM,CAAC;CAClC,KAAG,QAAQ,cAAc,GAAG,OAAO,CAiCnC,CAAC;AAEF,cAAc,UAAU,CAAC"}
package/build/index.js CHANGED
@@ -186,3 +186,4 @@ export const finishTransaction = ({ purchase, isConsumable, developerPayloadAndr
186
186
  }) || (() => Promise.reject(new Error('Unsupported Platform'))))();
187
187
  };
188
188
  export * from './useIap';
189
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,0EAA0E;AAC1E,wCAAwC;AACxC,OAAO,EAAC,kBAAkB,EAAE,YAAY,EAAC,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAC,QAAQ,EAAC,MAAM,cAAc,CAAC;AACtC,OAAO,EAGL,WAAW,GAOZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,aAAa,MAAM,iBAAiB,CAAC;AAU5C,OAAO,EAAC,YAAY,EAAE,wBAAwB,EAAC,MAAM,eAAe,CAAC;AACrE,OAAO,EACL,gBAAgB,EAChB,4BAA4B,GAC7B,MAAM,mBAAmB,CAAC;AAE3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAE9B,iCAAiC;AACjC,MAAM,CAAC,MAAM,EAAE,GAAG,aAAa,CAAC,EAAE,CAAC;AAEnC,MAAM,CAAN,IAAY,QAIX;AAJD,WAAY,QAAQ;IAClB,gDAAoC,CAAA;IACpC,4CAAgC,CAAA;IAChC,6DAAiD,CAAA;AACnD,CAAC,EAJW,QAAQ,KAAR,QAAQ,QAInB;AAED,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,KAAa;IAC/C,OAAO,MAAM,aAAa,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;AAClD,CAAC;AAED,M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AAQ,CAAC,aAAa,CAAC;YAE7C,IAAI,CAAC,aAAa,EAAE,CAAC;gBACnB,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAC9D,CAAC;YACJ,CAAC;YACD,MAAM,aAAa,CAAC,iBAAiB,CAAC,aAAa,CAAC,CAAC;YACrD,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAC/B,CAAC;QACD,OAAO,EAAE,KAAK,IAAI,EAAE;YAClB,IAAI,QAAQ,EAAE,aAAa,EAAE,CAAC;gBAC5B,IAAI,CAAC,YAAY,EAAE,CAAC;oBAClB,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CAAC,0CAA0C,CAAC,CACtD,CAAC;gBACJ,CAAC;gBAED,OAAO,aAAa,CAAC,cAAc,CACjC,QAAQ,CAAC,aAAa,EACtB,uBAAuB,CACxB,CAAC;YACJ,CAAC;YACD,OAAO,OAAO,CAAC,MAAM,CACnB,IAAI,KAAK,CAAC,0CAA0C,CAAC,CACtD,CAAC;QACJ,CAAC;KACF,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAChE,EAAE,CAAC;AACN,CAAC,CAAC;AAEF,cAAc,UAAU,CAAC","sourcesContent":["// Import the native module. On web, it will be resolved to ExpoIap.web.ts\n// and on native platforms to ExpoIap.ts\nimport {NativeModulesProxy, EventEmitter} from 'expo-modules-core';\nimport {Platform} from 'react-native';\nimport {\n Product,\n ProductPurchase,\n ProductType,\n Purchase,\n PurchaseError,\n PurchaseResult,\n RequestSubscriptionProps,\n SubscriptionProduct,\n SubscriptionPurchase,\n} from './ExpoIap.types';\nimport ExpoIapModule from './ExpoIapModule';\nimport {\n RequestPurchaseAndroidProps,\n RequestSubscriptionAndroidProps,\n} from './types/ExpoIapAndroid.types';\nimport {\n PaymentDiscount,\n RequestPurchaseIosProps,\n RequestSubscriptionIosProps,\n} from './types/ExpoIapIos.types';\nimport {isProductIos, isSubscriptionProductIos} from './modules/ios';\nimport {\n isProductAndroid,\n isSubscriptionProductAndroid,\n} from './modules/android';\n\nexport * from './modules/android';\nexport * from './modules/ios';\n\n// Get the native constant value.\nexport const PI = ExpoIapModule.PI;\n\nexport enum IapEvent {\n PurchaseUpdated = 'purchase-updated',\n PurchaseError = 'purchase-error',\n TransactionIapUpdated = 'iap-transaction-updated',\n}\n\nexport async function setValueAsync(value: string) {\n return await ExpoIapModule.setValueAsync(value);\n}\n\nexport const emitter = new EventEmitter(\n ExpoIapModule ?? NativeModulesProxy.ExpoIap,\n);\n\nexport const purchaseUpdatedListener = (\n listener: (event: Purchase) => void,\n) => {\n const emitterSubscription = emitter.addListener(\n IapEvent.PurchaseUpdated,\n listener,\n );\n return emitterSubscription;\n};\n\nexport const purchaseErrorListener = (\n listener: (error: PurchaseError) => void,\n) => {\n return emitter.addListener<PurchaseError>(IapEvent.PurchaseError, listener);\n};\n\nexport function initConnection() {\n return ExpoIapModule.initConnection();\n}\n\nexport const getProducts = async (skus: string[]): Promise<Product[]> => {\n console.log('getProducts', skus);\n if (!skus?.length) {\n return Promise.reject(new Error('\"skus\" is required'));\n }\n\n return Platform.select({\n ios: async () => {\n const items = await ExpoIapModule.getItems(skus);\n console.log('items', items);\n return items.filter((item: unknown) => isProductIos<Product>(item));\n },\n android: async () => {\n const products = await ExpoIapModule.getItemsByType(\n ProductType.InAppPurchase,\n skus,\n );\n return products.filter((product: unknown) =>\n isProductAndroid<Product>(product),\n );\n },\n default: () => Promise.reject(new Error('Unsupported Platform')),\n })();\n};\n\nexport const getSubscriptions = async (\n skus: string[],\n): Promise<SubscriptionProduct[]> => {\n if (!skus?.length) {\n return Promise.reject(new Error('\"skus\" is required'));\n }\n\n return Platform.select({\n ios: async () => {\n const rawItems = await ExpoIapModule.getItems(skus);\n\n return rawItems.filter((item: unknown) => {\n if (!isSubscriptionProductIos(item)) return false;\n return (\n typeof item === 'object' &&\n item !== null &&\n 'id' in item &&\n typeof item.id === 'string' &&\n skus.includes(item.id)\n );\n }) as SubscriptionProduct[];\n },\n android: async () => {\n const rawItems = await ExpoIapModule.getItemsByType('subs', skus);\n\n return rawItems.filter((item: unknown) => {\n if (!isSubscriptionProductAndroid(item)) return false;\n return (\n typeof item === 'object' &&\n item !== null &&\n 'id' in item &&\n typeof item.id === 'string' &&\n skus.includes(item.id)\n );\n }) as SubscriptionProduct[];\n },\n default: () => Promise.reject(new Error('Unsupported Platform')),\n })();\n};\n\nexport async function endConnection(): Promise<boolean> {\n return ExpoIapModule.endConnection();\n}\n\nexport const getPurchaseHistory = ({\n alsoPublishToEventListener = false,\n onlyIncludeActiveItems = false,\n}: {\n alsoPublishToEventListener?: boolean;\n onlyIncludeActiveItems?: boolean;\n} = {}): Promise<ProductPurchase[]> =>\n (\n Platform.select({\n ios: async () => {\n return ExpoIapModule.getAvailableItems(\n alsoPublishToEventListener,\n onlyIncludeActiveItems,\n );\n },\n android: async () => {\n const products = await ExpoIapModule.getPurchaseHistoryByType(\n ProductType.InAppPurchase,\n );\n\n const subscriptions = await ExpoIapModule.getPurchaseHistoryByType(\n ProductType.Subscription,\n );\n\n return products.concat(subscriptions);\n },\n }) || (() => Promise.resolve([]))\n )();\n\nexport const getAvailablePurchases = ({\n alsoPublishToEventListener = false,\n onlyIncludeActiveItems = true,\n}: {\n alsoPublishToEventListener?: boolean;\n onlyIncludeActiveItems?: boolean;\n} = {}): Promise<ProductPurchase[]> =>\n (\n Platform.select({\n ios: () =>\n ExpoIapModule.getAvailableItems(\n alsoPublishToEventListener,\n onlyIncludeActiveItems,\n ),\n android: async () => {\n const products = await ExpoIapModule.getAvailableItemsByType(\n ProductType.InAppPurchase,\n );\n\n const subscriptions = await ExpoIapModule.getAvailableItemsByType(\n ProductType.Subscription,\n );\n\n return products.concat(subscriptions);\n },\n }) || (() => Promise.resolve([]))\n )();\n\nconst offerToRecordIos = (\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\nexport const requestPurchase = (\n request: RequestPurchaseIosProps | RequestPurchaseAndroidProps,\n): Promise<ProductPurchase | ProductPurchase[] | void> =>\n (\n Platform.select({\n ios: async () => {\n if (!('sku' in request)) {\n throw new Error('sku is required for iOS purchase');\n }\n\n const {sku, appAccountToken, quantity, withOffer} = request;\n\n const offer = offerToRecordIos(withOffer);\n\n const purchase = await ExpoIapModule.buyProduct(\n sku,\n appAccountToken,\n quantity ?? -1,\n offer,\n );\n\n return Promise.resolve(purchase);\n },\n android: async () => {\n if (!('skus' in request) || !request.skus.length) {\n throw new Error('skus is required for Android purchase');\n }\n\n const {\n skus,\n obfuscatedAccountIdAndroid,\n obfuscatedProfileIdAndroid,\n isOfferPersonalized,\n } = request;\n\n return ExpoIapModule.buyItemByType({\n type: ProductType.InAppPurchase,\n skuArr: skus,\n purchaseToken: undefined,\n replacementMode: -1,\n obfuscatedAccountId: obfuscatedAccountIdAndroid,\n obfuscatedProfileId: obfuscatedProfileIdAndroid,\n offerTokenArr: [],\n isOfferPersonalized: isOfferPersonalized ?? false,\n });\n },\n }) || Promise.resolve\n )();\n\nexport const requestSubscription = (\n request: RequestSubscriptionProps,\n): Promise<SubscriptionPurchase | SubscriptionPurchase[] | null | void> =>\n (\n Platform.select({\n ios: async () => {\n if (!('sku' in request)) {\n throw new Error('sku is required for iOS subscriptions');\n }\n\n const {sku, appAccountToken, quantity, withOffer} =\n request as RequestSubscriptionIosProps;\n\n const offer = offerToRecordIos(withOffer);\n\n const purchase = await ExpoIapModule.buyProduct(\n sku,\n appAccountToken,\n quantity ?? -1,\n offer,\n );\n\n return Promise.resolve(purchase as SubscriptionPurchase);\n },\n android: async () => {\n const {\n skus,\n isOfferPersonalized,\n obfuscatedAccountIdAndroid,\n obfuscatedProfileIdAndroid,\n subscriptionOffers,\n replacementModeAndroid,\n purchaseTokenAndroid,\n } = request as RequestSubscriptionAndroidProps;\n\n return ExpoIapModule.buyItemByType({\n type: ProductType.Subscription,\n skuArr: skus.map((so) => so),\n purchaseToken: purchaseTokenAndroid,\n replacementMode: replacementModeAndroid,\n obfuscatedAccountId: obfuscatedAccountIdAndroid,\n obfuscatedProfileId: obfuscatedProfileIdAndroid,\n offerTokenArr: subscriptionOffers.map((so) => so.offerToken),\n isOfferPersonalized: isOfferPersonalized ?? false,\n });\n },\n }) || (() => Promise.resolve(null))\n )();\n\nexport const finishTransaction = ({\n purchase,\n isConsumable,\n developerPayloadAndroid,\n}: {\n purchase: Purchase;\n isConsumable?: boolean;\n developerPayloadAndroid?: string;\n}): Promise<PurchaseResult | boolean> => {\n return (\n Platform.select({\n ios: async () => {\n const transactionId = purchase.transactionId;\n\n if (!transactionId) {\n return Promise.reject(\n new Error('transactionId required to finish iOS transaction'),\n );\n }\n await ExpoIapModule.finishTransaction(transactionId);\n return Promise.resolve(true);\n },\n android: async () => {\n if (purchase?.purchaseToken) {\n if (!isConsumable) {\n return Promise.reject(\n new Error('purchase is not suitable to be purchased'),\n );\n }\n\n return ExpoIapModule.consumeProduct(\n purchase.purchaseToken,\n developerPayloadAndroid,\n );\n }\n return Promise.reject(\n new Error('purchase is not suitable to be purchased'),\n );\n },\n }) || (() => Promise.reject(new Error('Unsupported Platform')))\n )();\n};\n\nexport * from './useIap';\n"]}
@@ -0,0 +1,48 @@
1
+ import { PurchaseResult } from '../ExpoIap.types';
2
+ import { ReceiptAndroid } from '../types/ExpoIapAndroid.types';
3
+ export declare function isProductAndroid<T extends {
4
+ platform?: string;
5
+ }>(item: unknown): item is T & {
6
+ platform: 'android';
7
+ };
8
+ export declare function isSubscriptionProductAndroid<T extends {
9
+ platform?: string;
10
+ }>(item: unknown): item is T & {
11
+ platform: 'android';
12
+ };
13
+ /**
14
+ * Deep link to subscriptions screen on Android.
15
+ * @param {string} sku The product's SKU (on Android)
16
+ * @returns {Promise<void>}
17
+ */
18
+ export declare const deepLinkToSubscriptionsAndroid: ({ sku, }: {
19
+ sku: string;
20
+ }) => Promise<void>;
21
+ /**
22
+ * Validate receipt for Android. NOTE: This method is here for debugging purposes only. Including
23
+ * your access token in the binary you ship to users is potentially dangerous.
24
+ * Use server side validation instead for your production builds
25
+ * @param {string} packageName package name of your app.
26
+ * @param {string} productId product id for your in app product.
27
+ * @param {string} productToken token for your purchase.
28
+ * @param {string} accessToken accessToken from googleApis.
29
+ * @param {boolean} isSub whether this is subscription or inapp. `true` for subscription.
30
+ * @returns {Promise<object>}
31
+ */
32
+ export declare const validateReceiptAndroid: ({ packageName, productId, productToken, accessToken, isSub, }: {
33
+ packageName: string;
34
+ productId: string;
35
+ productToken: string;
36
+ accessToken: string;
37
+ isSub?: boolean;
38
+ }) => Promise<ReceiptAndroid>;
39
+ /**
40
+ * Acknowledge a product (on Android.) No-op on iOS.
41
+ * @param {string} token The product's token (on Android)
42
+ * @returns {Promise<PurchaseResult | void>}
43
+ */
44
+ export declare const acknowledgePurchaseAndroid: ({ token, developerPayload, }: {
45
+ token: string;
46
+ developerPayload?: string;
47
+ }) => Promise<PurchaseResult | boolean | void>;
48
+ //# sourceMappingURL=android.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"android.d.ts","sourceRoot":"","sources":["../../src/modules/android.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,cAAc,EAAC,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAC,cAAc,EAAC,MAAM,+BAA+B,CAAC;AAI7D,wBAAgB,gBAAgB,CAAC,CAAC,SAAS;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAC,EAC5D,IAAI,EAAE,OAAO,GACZ,IAAI,IAAI,CAAC,GAAG;IAAC,QAAQ,EAAE,SAAS,CAAA;CAAC,CAOnC;AAED,wBAAgB,4BAA4B,CAAC,CAAC,SAAS;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAC,EACxE,IAAI,EAAE,OAAO,GACZ,IAAI,IAAI,CAAC,GAAG;IAAC,QAAQ,EAAE,SAAS,CAAA;CAAC,CAEnC;AAED;;;;GAIG;AACH,eAAO,MAAM,8BAA8B,aAExC;IACD,GAAG,EAAE,MAAM,CAAC;CACb,KAAG,QAAQ,IAAI,CAIf,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,sBAAsB,kEAMhC;IACD,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,KAAG,QAAQ,cAAc,CAsBzB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,iCAGpC;IACD,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,KAAG,QAAQ,cAAc,GAAG,OAAO,GAAG,IAAI,CAE1C,CAAC"}
@@ -55,3 +55,4 @@ export const validateReceiptAndroid = async ({ packageName, productId, productTo
55
55
  export const acknowledgePurchaseAndroid = ({ token, developerPayload, }) => {
56
56
  return ExpoIapModule.acknowledgePurchase(token, developerPayload);
57
57
  };
58
+ //# sourceMappingURL=android.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"android.js","sourceRoot":"","sources":["../../src/modules/android.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,cAAc,CAAC;AAGrC,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAE7C,cAAc;AACd,MAAM,UAAU,gBAAgB,CAC9B,IAAa;IAEb,OAAO,CACL,IAAI,IAAI,IAAI;QACZ,OAAO,IAAI,KAAK,QAAQ;QACxB,UAAU,IAAI,IAAI;QAClB,IAAI,CAAC,QAAQ,KAAK,SAAS,CAC5B,CAAC;AACJ,CAAC;AAED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,gBAAgB,CAAC,CAAC;AACpE,CAAC,CAAC","sourcesContent":["import {Linking} from 'react-native';\nimport {PurchaseResult} from '../ExpoIap.types';\nimport {ReceiptAndroid} from '../types/ExpoIapAndroid.types';\nimport ExpoIapModule from '../ExpoIapModule';\n\n// Type guards\nexport function isProductAndroid<T extends {platform?: string}>(\n item: unknown,\n): item is T & {platform: 'android'} {\n return (\n item != null &&\n typeof item === 'object' &&\n 'platform' in item &&\n item.platform === 'android'\n );\n}\n\nexport function isSubscriptionProductAndroid<T extends {platform?: string}>(\n item: unknown,\n): item is T & {platform: 'android'} {\n return isProductAndroid(item);\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: string;\n}): Promise<void> => {\n return Linking.openURL(\n `https://play.google.com/store/account/subscriptions?package=${await ExpoIapModule.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<ReceiptAndroid> => {\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 ExpoIapModule.acknowledgePurchase(token, developerPayload);\n};\n"]}
@@ -0,0 +1,49 @@
1
+ import { ProductPurchase, PurchaseError } from '../ExpoIap.types';
2
+ import type { ProductStatusIos } from '../types/ExpoIapIos.types';
3
+ export type TransactionEvent = {
4
+ transaction?: ProductPurchase;
5
+ error?: PurchaseError;
6
+ };
7
+ export declare const transactionUpdatedIos: (listener: (event: TransactionEvent) => void) => import("expo-modules-core").Subscription;
8
+ export declare function isProductIos<T extends {
9
+ platform?: string;
10
+ }>(item: unknown): item is T & {
11
+ platform: 'ios';
12
+ };
13
+ export declare function isSubscriptionProductIos<T extends {
14
+ platform?: string;
15
+ }>(item: unknown): item is T & {
16
+ platform: 'ios';
17
+ };
18
+ /**
19
+ * Sync state with Appstore (iOS only)
20
+ * https://developer.apple.com/documentation/storekit/appstore/3791906-sync
21
+ */
22
+ export declare const sync: () => Promise<null>;
23
+ /**
24
+ *
25
+ */
26
+ export declare const isEligibleForIntroOffer: (groupID: string) => Promise<boolean>;
27
+ /**
28
+ *
29
+ */
30
+ export declare const subscriptionStatus: (sku: string) => Promise<ProductStatusIos[]>;
31
+ /**
32
+ *
33
+ */
34
+ export declare const currentEntitlement: (sku: string) => Promise<ProductPurchase>;
35
+ /**
36
+ *
37
+ */
38
+ export declare const latestTransaction: (sku: string) => Promise<ProductPurchase>;
39
+ /**
40
+ *
41
+ */
42
+ type RefundRequestStatus = 'success' | 'userCancelled';
43
+ export declare const beginRefundRequest: (sku: string) => Promise<RefundRequestStatus>;
44
+ /**
45
+ *
46
+ */
47
+ export declare const showManageSubscriptions: () => Promise<null>;
48
+ export {};
49
+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,KAAK,mBAAmB,GAAG,SAAS,GAAG,eAAe,CAAC;AACvD,eAAO,MAAM,kBAAkB,QAAS,MAAM,KAAG,QAAQ,mBAAmB,CACrC,CAAC;AAExC;;GAEG;AACH,eAAO,MAAM,uBAAuB,QAAO,QAAQ,IAAI,CACd,CAAC"}
@@ -45,3 +45,4 @@ export const beginRefundRequest = (sku) => ExpoIapModule.beginRefundRequest(sku)
45
45
  *
46
46
  */
47
47
  export const showManageSubscriptions = () => ExpoIapModule.showManageSubscriptions();
48
+ //# sourceMappingURL=ios.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ios.js","sourceRoot":"","sources":["../../src/modules/ios.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,cAAc,CAAC;AACtC,OAAO,EAAC,OAAO,EAAE,QAAQ,EAAC,MAAM,IAAI,CAAC;AAGrC,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAO7C,YAAY;AACZ,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACnC,QAA2C,EAC3C,EAAE;IACF,IAAI,QAAQ,CAAC,EAAE,KAAK,KAAK,EAAE,CAAC;QAC1B,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;IAC1D,CAAC;IAED,OAAO,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,qBAAqB,EAAE,QAAQ,CAAC,CAAC;AACvE,CAAC,CAAC;AAEF,cAAc;AACd,MAAM,UAAU,YAAY,CAC1B,IAAa;IAEb,OAAO,CACL,IAAI,IAAI,IAAI;QACZ,OAAO,IAAI,KAAK,QAAQ;QACxB,UAAU,IAAI,IAAI;QAClB,IAAI,CAAC,QAAQ,KAAK,KAAK,CACxB,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,wBAAwB,CACtC,IAAa;IAEb,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC;AAC5B,CAAC;AAED,YAAY;AACZ;;;GAGG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,GAAkB,EAAE,CAAC,aAAa,CAAC,IAAI,EAAE,CAAC;AAE9D;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,OAAe,EAAoB,EAAE,CAC3E,aAAa,CAAC,uBAAuB,CAAC,OAAO,CAAC,CAAC;AAEjD;;GAEG;AAEH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,GAAW,EAA+B,EAAE,CAC7E,aAAa,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC;AAExC;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,GAAW,EAA4B,EAAE,CAC1E,aAAa,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC;AAExC;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,GAAW,EAA4B,EAAE,CACzE,aAAa,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC;AAMvC,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,GAAW,EAAgC,EAAE,CAC9E,aAAa,CAAC,kBAAkB,CAAC,GAAG,CAAC,CAAC;AAExC;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAkB,EAAE,CACzD,aAAa,CAAC,uBAAuB,EAAE,CAAC","sourcesContent":["import {Platform} from 'react-native';\nimport {emitter, IapEvent} from '..';\nimport {ProductPurchase, PurchaseError} from '../ExpoIap.types';\nimport type {ProductStatusIos} from '../types/ExpoIapIos.types';\nimport ExpoIapModule from '../ExpoIapModule';\n\nexport type TransactionEvent = {\n transaction?: ProductPurchase;\n error?: PurchaseError;\n};\n\n// Listeners\nexport const transactionUpdatedIos = (\n listener: (event: TransactionEvent) => void,\n) => {\n if (Platform.OS !== 'ios') {\n throw new Error('This method is only available on iOS');\n }\n\n return emitter.addListener(IapEvent.TransactionIapUpdated, listener);\n};\n\n// Type guards\nexport function isProductIos<T extends {platform?: string}>(\n item: unknown,\n): item is T & {platform: 'ios'} {\n return (\n item != null &&\n typeof item === 'object' &&\n 'platform' in item &&\n item.platform === 'ios'\n );\n}\n\nexport function isSubscriptionProductIos<T extends {platform?: string}>(\n item: unknown,\n): item is T & {platform: 'ios'} {\n return isProductIos(item);\n}\n\n// Functions\n/**\n * Sync state with Appstore (iOS only)\n * https://developer.apple.com/documentation/storekit/appstore/3791906-sync\n */\nexport const sync = (): Promise<null> => ExpoIapModule.sync();\n\n/**\n *\n */\nexport const isEligibleForIntroOffer = (groupID: string): Promise<boolean> =>\n ExpoIapModule.isEligibleForIntroOffer(groupID);\n\n/**\n *\n */\n\nexport const subscriptionStatus = (sku: string): Promise<ProductStatusIos[]> =>\n ExpoIapModule.subscriptionStatus(sku);\n\n/**\n *\n */\nexport const currentEntitlement = (sku: string): Promise<ProductPurchase> =>\n ExpoIapModule.currentEntitlement(sku);\n\n/**\n *\n */\nexport const latestTransaction = (sku: string): Promise<ProductPurchase> =>\n ExpoIapModule.latestTransaction(sku);\n\n/**\n *\n */\ntype RefundRequestStatus = 'success' | 'userCancelled';\nexport const beginRefundRequest = (sku: string): Promise<RefundRequestStatus> =>\n ExpoIapModule.beginRefundRequest(sku);\n\n/**\n *\n */\nexport const showManageSubscriptions = (): Promise<null> =>\n ExpoIapModule.showManageSubscriptions();\n"]}
@@ -0,0 +1,113 @@
1
+ import { PurchaseBase, ProductBase } from '../ExpoIap.types';
2
+ type OneTimePurchaseOfferDetails = {
3
+ priceCurrencyCode: string;
4
+ formattedPrice: string;
5
+ priceAmountMicros: string;
6
+ };
7
+ type PricingPhaseAndroid = {
8
+ formattedPrice: string;
9
+ priceCurrencyCode: string;
10
+ billingPeriod: string;
11
+ billingCycleCount: number;
12
+ priceAmountMicros: string;
13
+ recurrenceMode: number;
14
+ };
15
+ type PricingPhasesAndroid = {
16
+ pricingPhaseList: PricingPhaseAndroid[];
17
+ };
18
+ type SubscriptionOfferDetail = {
19
+ basePlanId: string;
20
+ offerId: string;
21
+ offerToken: string;
22
+ offerTags: string[];
23
+ pricingPhases: PricingPhasesAndroid;
24
+ };
25
+ export type ProductAndroid = ProductBase & {
26
+ name: string;
27
+ oneTimePurchaseOfferDetails?: OneTimePurchaseOfferDetails;
28
+ subscriptionOfferDetails?: SubscriptionOfferDetail[];
29
+ };
30
+ type SubscriptionOfferAndroid = {
31
+ basePlanId: string;
32
+ offerId: string | null;
33
+ offerToken: string;
34
+ pricingPhases: PricingPhasesAndroid;
35
+ offerTags: string[];
36
+ };
37
+ export type SubscriptionProductAndroid = ProductAndroid & {
38
+ subscriptionOfferDetails: SubscriptionOfferAndroid[];
39
+ };
40
+ export type RequestPurchaseAndroidProps = {
41
+ skus: string[];
42
+ obfuscatedAccountIdAndroid?: string;
43
+ obfuscatedProfileIdAndroid?: string;
44
+ isOfferPersonalized?: boolean;
45
+ };
46
+ declare enum ReplacementModesAndroid {
47
+ UNKNOWN_REPLACEMENT_MODE = 0,
48
+ WITH_TIME_PRORATION = 1,
49
+ CHARGE_PRORATED_PRICE = 2,
50
+ WITHOUT_PRORATION = 3,
51
+ CHARGE_FULL_PRICE = 5,
52
+ DEFERRED = 6
53
+ }
54
+ type SubscriptionOffer = {
55
+ sku: string;
56
+ offerToken: string;
57
+ };
58
+ export type RequestSubscriptionAndroidProps = RequestPurchaseAndroidProps & {
59
+ purchaseTokenAndroid?: string;
60
+ replacementModeAndroid?: ReplacementModesAndroid;
61
+ subscriptionOffers: SubscriptionOffer[];
62
+ };
63
+ export type ReceiptAndroid = {
64
+ autoRenewing: boolean;
65
+ betaProduct: boolean;
66
+ cancelDate: number | null;
67
+ cancelReason: string;
68
+ deferredDate: number | null;
69
+ deferredSku: number | null;
70
+ freeTrialEndDate: number;
71
+ gracePeriodEndDate: number;
72
+ parentProductId: string;
73
+ productId: string;
74
+ productType: string;
75
+ purchaseDate: number;
76
+ quantity: number;
77
+ receiptId: string;
78
+ renewalDate: number;
79
+ term: string;
80
+ termSku: string;
81
+ testTransaction: boolean;
82
+ };
83
+ export declare enum FeatureTypeAndroid {
84
+ /** Show in-app messages. Included in documentation by the annotations: */
85
+ IN_APP_MESSAGING = "IN_APP_MESSAGING",
86
+ /** Launch a price change confirmation flow. */
87
+ PRICE_CHANGE_CONFIRMATION = "PRICE_CHANGE_CONFIRMATION",
88
+ /** Play billing library support for querying and purchasing with ProductDetails. */
89
+ PRODUCT_DETAILS = "PRODUCT_DETAILS",
90
+ /** Purchase/query for subscriptions. */
91
+ SUBSCRIPTIONS = "SUBSCRIPTIONS",
92
+ /** Subscriptions update/replace. */
93
+ SUBSCRIPTIONS_UPDATE = "SUBSCRIPTIONS_UPDATE"
94
+ }
95
+ export declare enum PurchaseStateAndroid {
96
+ UNSPECIFIED_STATE = 0,
97
+ PURCHASED = 1,
98
+ PENDING = 2
99
+ }
100
+ export type ProductPurchaseAndroid = PurchaseBase & {
101
+ ids?: string[];
102
+ dataAndroid?: string;
103
+ signatureAndroid?: string;
104
+ autoRenewingAndroid?: boolean;
105
+ purchaseStateAndroid?: PurchaseStateAndroid;
106
+ isAcknowledgedAndroid?: boolean;
107
+ packageNameAndroid?: string;
108
+ developerPayloadAndroid?: string;
109
+ obfuscatedAccountIdAndroid?: string;
110
+ obfuscatedProfileIdAndroid?: string;
111
+ };
112
+ export {};
113
+ //# sourceMappingURL=ExpoIapAndroid.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpoIapAndroid.types.d.ts","sourceRoot":"","sources":["../../src/types/ExpoIapAndroid.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAE,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAE3D,KAAK,2BAA2B,GAAG;IACjC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,KAAK,mBAAmB,GAAG;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAC;IAE1B,aAAa,EAAE,MAAM,CAAC;IACtB,iBAAiB,EAAE,MAA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E,MAAM,EAAE,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,uBAAuB,CAAC,EAAE,MAAM,CAAC;IACjC,0BAA0B,CAAC,EAAE,MAAM,CAAC;IACpC,0BAA0B,CAAC,EAAE,MAAM,CAAC;CACrC,CAAC"}
@@ -26,3 +26,4 @@ export var PurchaseStateAndroid;
26
26
  PurchaseStateAndroid[PurchaseStateAndroid["PURCHASED"] = 1] = "PURCHASED";
27
27
  PurchaseStateAndroid[PurchaseStateAndroid["PENDING"] = 2] = "PENDING";
28
28
  })(PurchaseStateAndroid || (PurchaseStateAndroid = {}));
29
+ //# sourceMappingURL=ExpoIapAndroid.types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpoIapAndroid.types.js","sourceRoot":"","sources":["../../src/types/ExpoIapAndroid.types.ts"],"names":[],"mappings":"AAuDA,IAAK,uBAOJ;AAPD,WAAK,uBAAuB;IAC1B,6GAA4B,CAAA;IAC5B,mGAAuB,CAAA;IACvB,uGAAyB,CAAA;IACzB,+FAAqB,CAAA;IACrB,+FAAqB,CAAA;IACrB,6EAAY,CAAA;AACd,CAAC,EAPI,uBAAuB,KAAvB,uBAAuB,QAO3B;AAkCD,MAAM,CAAN,IAAY,kBAWX;AAXD,WAAY,kBAAkB;IAC5B,0EAA0E;IAC1E,2DAAqC,CAAA;IACrC,+CAA+C;IAC/C,6EAAuD,CAAA;IACvD,oFAAoF;IACpF,yDAAmC,CAAA;IACnC,wCAAwC;IACxC,qDAA+B,CAAA;IAC/B,oCAAoC;IACpC,mEAA6C,CAAA;AAC/C,CAAC,EAXW,kBAAkB,KAAlB,kBAAkB,QAW7B;AAED,MAAM,CAAN,IAAY,oBAIX;AAJD,WAAY,oBAAoB;IAC9B,yFAAqB,CAAA;IACrB,yEAAa,CAAA;IACb,qEAAW,CAAA;AACb,CAAC,EAJW,oBAAoB,KAApB,oBAAoB,QAI/B","sourcesContent":["import {PurchaseBase, ProductBase} from '../ExpoIap.types';\n\ntype OneTimePurchaseOfferDetails = {\n priceCurrencyCode: string;\n formattedPrice: string;\n priceAmountMicros: string;\n};\n\ntype PricingPhaseAndroid = {\n formattedPrice: string;\n priceCurrencyCode: string;\n // P1W, P1M, P1Y\n billingPeriod: string;\n billingCycleCount: number;\n priceAmountMicros: string;\n recurrenceMode: number;\n};\n\ntype PricingPhasesAndroid = {\n pricingPhaseList: PricingPhaseAndroid[];\n};\n\ntype SubscriptionOfferDetail = {\n basePlanId: string;\n offerId: string;\n offerToken: string;\n offerTags: string[];\n pricingPhases: PricingPhasesAndroid;\n};\n\nexport type ProductAndroid = ProductBase & {\n name: string;\n oneTimePurchaseOfferDetails?: OneTimePurchaseOfferDetails;\n subscriptionOfferDetails?: SubscriptionOfferDetail[];\n};\n\ntype SubscriptionOfferAndroid = {\n basePlanId: string;\n offerId: string | null;\n offerToken: string;\n pricingPhases: PricingPhasesAndroid;\n offerTags: string[];\n};\n\nexport type SubscriptionProductAndroid = ProductAndroid & {\n subscriptionOfferDetails: SubscriptionOfferAndroid[];\n};\n\nexport type RequestPurchaseAndroidProps = {\n skus: string[];\n obfuscatedAccountIdAndroid?: string;\n obfuscatedProfileIdAndroid?: string;\n isOfferPersonalized?: boolean; // For AndroidBilling V5 https://developer.android.com/google/play/billing/integrate#personalized-price\n};\n\nenum ReplacementModesAndroid {\n UNKNOWN_REPLACEMENT_MODE = 0,\n WITH_TIME_PRORATION = 1,\n CHARGE_PRORATED_PRICE = 2,\n WITHOUT_PRORATION = 3,\n CHARGE_FULL_PRICE = 5,\n DEFERRED = 6,\n}\n\ntype SubscriptionOffer = {\n sku: string;\n offerToken: string;\n};\n\nexport type RequestSubscriptionAndroidProps = RequestPurchaseAndroidProps & {\n purchaseTokenAndroid?: string;\n replacementModeAndroid?: ReplacementModesAndroid;\n subscriptionOffers: SubscriptionOffer[];\n};\n\nexport type ReceiptAndroid = {\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};\n\nexport enum FeatureTypeAndroid {\n /** Show in-app messages. Included in documentation by the annotations: */\n IN_APP_MESSAGING = 'IN_APP_MESSAGING',\n /** Launch a price change confirmation flow. */\n PRICE_CHANGE_CONFIRMATION = 'PRICE_CHANGE_CONFIRMATION',\n /** Play billing library support for querying and purchasing with ProductDetails. */\n PRODUCT_DETAILS = 'PRODUCT_DETAILS',\n /** Purchase/query for subscriptions. */\n SUBSCRIPTIONS = 'SUBSCRIPTIONS',\n /** Subscriptions update/replace. */\n SUBSCRIPTIONS_UPDATE = 'SUBSCRIPTIONS_UPDATE',\n}\n\nexport enum PurchaseStateAndroid {\n UNSPECIFIED_STATE = 0,\n PURCHASED = 1,\n PENDING = 2,\n}\n\nexport type ProductPurchaseAndroid = PurchaseBase & {\n ids?: 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};\n"]}
@@ -0,0 +1,118 @@
1
+ import { PurchaseBase, ProductBase } from '../ExpoIap.types';
2
+ type SubscriptionIosPeriod = 'DAY' | 'WEEK' | 'MONTH' | 'YEAR' | '';
3
+ type PaymentMode = '' | 'FREETRIAL' | 'PAYASYOUGO' | 'PAYUPFRONT';
4
+ type SubscriptionOffer = {
5
+ displayPrice: string;
6
+ id: string;
7
+ paymentMode: PaymentMode;
8
+ period: SubscriptionIosPeriod;
9
+ periodCount: number;
10
+ price: number;
11
+ type: 'introductory' | 'promotional';
12
+ };
13
+ type SubscriptionInfo = {
14
+ introductoryOffer?: SubscriptionOffer;
15
+ promotionalOffers?: SubscriptionOffer[];
16
+ subscriptionGroupID: string;
17
+ subscriptionPeriod: SubscriptionIosPeriod;
18
+ };
19
+ export type ProductIos = ProductBase & {
20
+ displayName: string;
21
+ displayPrice: string;
22
+ isFamilyShareable: boolean;
23
+ jsonRepresentation: string;
24
+ subscription: SubscriptionInfo;
25
+ introductoryPriceNumberOfPeriodsIOS?: string;
26
+ introductoryPriceSubscriptionPeriodIOS?: SubscriptionIosPeriod;
27
+ };
28
+ export type Discount = {
29
+ identifier: string;
30
+ type: string;
31
+ numberOfPeriods: string;
32
+ price: string;
33
+ localizedPrice: string;
34
+ paymentMode: PaymentMode;
35
+ subscriptionPeriod: string;
36
+ };
37
+ export type SubscriptionProductIos = ProductIos & {
38
+ discounts?: Discount[];
39
+ introductoryPrice?: string;
40
+ introductoryPriceAsAmountIOS?: string;
41
+ introductoryPricePaymentModeIOS?: PaymentMode;
42
+ introductoryPriceNumberOfPeriodsIOS?: string;
43
+ introductoryPriceSubscriptionPeriodIOS?: SubscriptionIosPeriod;
44
+ subscriptionPeriodNumberIOS?: string;
45
+ subscriptionPeriodUnitIOS?: SubscriptionIosPeriod;
46
+ };
47
+ export type PaymentDiscount = {
48
+ /**
49
+ * A string used to uniquely identify a discount offer for a product.
50
+ */
51
+ identifier: string;
52
+ /**
53
+ * A string that identifies the key used to generate the signature.
54
+ */
55
+ keyIdentifier: string;
56
+ /**
57
+ * A universally unique ID (UUID) value that you define.
58
+ */
59
+ nonce: string;
60
+ /**
61
+ * A UTF-8 string representing the properties of a specific discount offer, cryptographically signed.
62
+ */
63
+ signature: string;
64
+ /**
65
+ * The date and time of the signature's creation in milliseconds, formatted in Unix epoch time.
66
+ */
67
+ timestamp: number;
68
+ };
69
+ export type RequestPurchaseIosProps = {
70
+ sku: string;
71
+ /**
72
+ * UUID representing user account
73
+ */
74
+ appAccountToken?: string;
75
+ quantity?: number;
76
+ withOffer?: PaymentDiscount;
77
+ };
78
+ export type RequestSubscriptionIosProps = RequestPurchaseIosProps;
79
+ type SubscriptionStatus = 'expired' | 'inBillingRetryPeriod' | 'inGracePeriod' | 'revoked' | 'subscribed';
80
+ type RenewalInfo = {
81
+ jsonRepresentation?: string;
82
+ willAutoRenew: boolean;
83
+ autoRenewPreference?: string;
84
+ };
85
+ export type ProductStatusIos = {
86
+ state: SubscriptionStatus;
87
+ renewalInfo?: RenewalInfo;
88
+ };
89
+ export type ProductPurchaseIos = PurchaseBase & {
90
+ quantityIos?: number;
91
+ originalTransactionDateIos?: number;
92
+ originalTransactionIdentifierIos?: string;
93
+ verificationResultIos?: string;
94
+ appAccountToken?: string;
95
+ expirationDateIos?: number;
96
+ webOrderLineItemIdIos?: number;
97
+ environmentIos?: string;
98
+ storefrontCountryCodeIos?: string;
99
+ appBundleIdIos?: string;
100
+ productTypeIos?: string;
101
+ subscriptionGroupIdIos?: string;
102
+ isUpgradedIos?: boolean;
103
+ ownershipTypeIos?: string;
104
+ reasonIos?: string;
105
+ reasonStringRepresentationIos?: string;
106
+ transactionReasonIos?: 'PURCHASE' | 'RENEWAL' | string;
107
+ revocationDateIos?: number;
108
+ revocationReasonIos?: string;
109
+ offerIos?: {
110
+ id: string;
111
+ type: string;
112
+ paymentMode: string;
113
+ };
114
+ priceIos?: number;
115
+ currencyIos?: string;
116
+ };
117
+ export {};
118
+ //# sourceMappingURL=ExpoIapIos.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ExpoIapIos.types.d.ts","sourceRoot":"","sources":["../../src/types/ExpoIapIos.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAE,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAE3D,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