expo-iap 2.2.4-rc.1 → 2.2.4-rc.2
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/android/src/main/java/expo/modules/iap/ExpoIapModule.kt +4 -4
- package/build/ExpoIap.types.d.ts +1 -0
- package/build/ExpoIap.types.d.ts.map +1 -1
- package/build/ExpoIap.types.js.map +1 -1
- package/build/types/ExpoIapAndroid.types.d.ts +0 -1
- package/build/types/ExpoIapAndroid.types.d.ts.map +1 -1
- package/build/types/ExpoIapAndroid.types.js.map +1 -1
- package/ios/ExpoIapModule.swift +16 -26
- package/package.json +1 -1
- package/src/ExpoIap.types.ts +1 -0
- package/src/types/ExpoIapAndroid.types.ts +0 -1
|
@@ -75,7 +75,7 @@ class ExpoIapModule :
|
|
|
75
75
|
"ids" to purchase.products,
|
|
76
76
|
"transactionId" to purchase.orderId,
|
|
77
77
|
"transactionDate" to purchase.purchaseTime.toDouble(),
|
|
78
|
-
"
|
|
78
|
+
"transactionReceipt" to purchase.originalJson,
|
|
79
79
|
"purchaseTokenAndroid" to purchase.purchaseToken,
|
|
80
80
|
"dataAndroid" to purchase.originalJson,
|
|
81
81
|
"signatureAndroid" to purchase.signature,
|
|
@@ -225,9 +225,9 @@ class ExpoIapModule :
|
|
|
225
225
|
"ids" to purchase.products,
|
|
226
226
|
"transactionId" to purchase.orderId,
|
|
227
227
|
"transactionDate" to purchase.purchaseTime.toDouble(),
|
|
228
|
-
"
|
|
228
|
+
"transactionReceipt" to purchase.originalJson,
|
|
229
229
|
"orderId" to purchase.orderId,
|
|
230
|
-
"
|
|
230
|
+
"purchaseTokenAndroid" to purchase.purchaseToken,
|
|
231
231
|
"developerPayloadAndroid" to purchase.developerPayload,
|
|
232
232
|
"signatureAndroid" to purchase.signature,
|
|
233
233
|
"purchaseStateAndroid" to purchase.purchaseState,
|
|
@@ -272,7 +272,7 @@ class ExpoIapModule :
|
|
|
272
272
|
"id" to purchase.products.firstOrNull() as Any?,
|
|
273
273
|
"ids" to purchase.products,
|
|
274
274
|
"transactionDate" to purchase.purchaseTime.toDouble(),
|
|
275
|
-
"
|
|
275
|
+
"transactionReceipt" to purchase.originalJson,
|
|
276
276
|
"purchaseTokenAndroid" to purchase.purchaseToken,
|
|
277
277
|
"dataAndroid" to purchase.originalJson,
|
|
278
278
|
"signatureAndroid" to purchase.signature,
|
package/build/ExpoIap.types.d.ts
CHANGED
|
@@ -30,6 +30,7 @@ export type PurchaseBase = {
|
|
|
30
30
|
id: string;
|
|
31
31
|
transactionId?: string;
|
|
32
32
|
transactionDate: number;
|
|
33
|
+
transactionReceipt: string;
|
|
33
34
|
};
|
|
34
35
|
export type Product = (ProductAndroid & AndroidPlatform) | (ProductIos & IosPlatform);
|
|
35
36
|
export type ProductPurchase = (ProductPurchaseAndroid & AndroidPlatform) | (ProductPurchaseIos & IosPlatform);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ExpoIap.types.d.ts","sourceRoot":"","sources":["../src/ExpoIap.types.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,sBAAsB,EACtB,2BAA2B,EAC3B,+BAA+B,EAC/B,0BAA0B,EAC3B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,UAAU,EACV,kBAAkB,EAClB,uBAAuB,EACvB,2BAA2B,EAC3B,sBAAsB,EACvB,MAAM,0BAA0B,CAAC;AAElC,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,WAAW,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CA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AmB;IACjC,eAAe,oBAAoB;IACnC,eAAe,oBAAoB;IACnC,gBAAgB,qBAAqB;IACrC,yBAAyB,8BAA8B;IACvD,cAAc,mBAAmB;IACjC,WAAW,gBAAgB;IAC3B,eAAe,oBAAoB;IACnC,iBAAiB,sBAAsB;IACvC,mCAAmC,wCAAwC;IAC3E,kBAAkB,uBAAuB;IACzC,aAAa,kBAAkB;IAC/B,mBAAmB,wBAAwB;CAC5C;AAED,qBAAa,aAAc,YAAW,KAAK;IAEhC,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,MAAM;IACf,YAAY,CAAC;IACb,YAAY,CAAC;IACb,IAAI,CAAC;IACL,SAAS,CAAC;gBALV,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,MAAM,EACf,YAAY,CAAC,oBAAQ,EACrB,YAAY,CAAC,oBAAQ,EACrB,IAAI,CAAC,uBAAW,EAChB,SAAS,CAAC,oBAAQ;CAS5B"}
|
|
@@ -1 +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;
|
|
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;AA+CD,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};\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 purchaseTokenAndroid?: 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"]}
|
|
@@ -99,7 +99,6 @@ export declare enum PurchaseStateAndroid {
|
|
|
99
99
|
}
|
|
100
100
|
export type ProductPurchaseAndroid = PurchaseBase & {
|
|
101
101
|
ids?: string[];
|
|
102
|
-
transactionReceiptAndroid?: string;
|
|
103
102
|
purchaseTokenAndroid?: string;
|
|
104
103
|
dataAndroid?: string;
|
|
105
104
|
signatureAndroid?: string;
|
|
@@ -1 +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,CA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AuB,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
|
|
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 purchaseTokenAndroid?: 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"]}
|
package/ios/ExpoIapModule.swift
CHANGED
|
@@ -27,9 +27,11 @@ func serializeTransaction(_ transaction: Transaction) -> [String: Any?] {
|
|
|
27
27
|
var webOrderLineItemId: Int? = nil
|
|
28
28
|
var jsonData: [String: Any]? = nil
|
|
29
29
|
|
|
30
|
-
// JSON representation handling
|
|
30
|
+
// JSON representation handling (JWS 데이터)
|
|
31
|
+
var jwsReceipt: String
|
|
31
32
|
do {
|
|
32
33
|
let jsonRep = transaction.jsonRepresentation
|
|
34
|
+
jwsReceipt = String(data: jsonRep, encoding: .utf8) ?? "" // JWS 형식으로 변환
|
|
33
35
|
let jsonObj = try JSONSerialization.jsonObject(with: jsonRep) as! [String: Any]
|
|
34
36
|
jsonData = jsonObj
|
|
35
37
|
if let reason = jsonObj["transactionReason"] as? String {
|
|
@@ -40,6 +42,7 @@ func serializeTransaction(_ transaction: Transaction) -> [String: Any?] {
|
|
|
40
42
|
}
|
|
41
43
|
} catch {
|
|
42
44
|
print("Error parsing JSON representation: \(error)")
|
|
45
|
+
jwsReceipt = ""
|
|
43
46
|
}
|
|
44
47
|
|
|
45
48
|
// Create base purchase object that matches Purchase type in TypeScript
|
|
@@ -49,6 +52,7 @@ func serializeTransaction(_ transaction: Transaction) -> [String: Any?] {
|
|
|
49
52
|
"ids": [transaction.productID],
|
|
50
53
|
"transactionId": String(transaction.id),
|
|
51
54
|
"transactionDate": transaction.purchaseDate.timeIntervalSince1970 * 1000,
|
|
55
|
+
"transactionReceipt": jwsReceipt, // JWS 데이터를 transactionReceipt에 담음
|
|
52
56
|
|
|
53
57
|
// iOS specific fields - basic info
|
|
54
58
|
"quantityIos": transaction.purchasedQuantity,
|
|
@@ -91,8 +95,7 @@ func serializeTransaction(_ transaction: Transaction) -> [String: Any?] {
|
|
|
91
95
|
purchaseMap["reasonIos"] = transaction.reason.rawValue
|
|
92
96
|
}
|
|
93
97
|
|
|
94
|
-
// reasonStringRepresentation
|
|
95
|
-
purchaseMap["reasonStringRepresentationIos"] = transaction.reasonStringRepresentation
|
|
98
|
+
// reasonStringRepresentation은 Transaction에 없으므로 제거
|
|
96
99
|
purchaseMap["transactionReasonIos"] = transactionReasonIos
|
|
97
100
|
|
|
98
101
|
// Add offer information if available with proper availability check
|
|
@@ -134,7 +137,7 @@ func serializeProduct(_ p: Product) -> [String: Any?] {
|
|
|
134
137
|
"subscription": p.subscription,
|
|
135
138
|
"type": p.type,
|
|
136
139
|
"currency": p.priceFormatStyle.currencyCode,
|
|
137
|
-
"platform": "ios",
|
|
140
|
+
"platform": "ios",
|
|
138
141
|
]
|
|
139
142
|
}
|
|
140
143
|
|
|
@@ -164,7 +167,6 @@ func serializeRenewalInfo(_ renewalInfo: VerificationResult<Product.Subscription
|
|
|
164
167
|
switch renewalInfo {
|
|
165
168
|
case .unverified:
|
|
166
169
|
return nil
|
|
167
|
-
|
|
168
170
|
case .verified(let info):
|
|
169
171
|
return [
|
|
170
172
|
"autoRenewStatus": info.willAutoRenew,
|
|
@@ -218,18 +220,13 @@ public class ExpoIapModule: Module {
|
|
|
218
220
|
|
|
219
221
|
do {
|
|
220
222
|
let fetchedProducts = try await Product.products(for: skus)
|
|
221
|
-
|
|
222
223
|
await productStore.performOnActor { isolatedStore in
|
|
223
|
-
fetchedProducts.forEach
|
|
224
|
+
fetchedProducts.forEach { product in
|
|
224
225
|
isolatedStore.addProduct(product)
|
|
225
|
-
}
|
|
226
|
+
}
|
|
226
227
|
}
|
|
227
|
-
|
|
228
228
|
let products = await productStore.getAllProducts()
|
|
229
|
-
|
|
230
|
-
return products.map { (prod: Product) -> [String: Any?]? in
|
|
231
|
-
return serializeProduct(prod)
|
|
232
|
-
}.compactMap { $0 }
|
|
229
|
+
return products.map { serializeProduct($0) }.compactMap { $0 }
|
|
233
230
|
} catch {
|
|
234
231
|
print("Error fetching items: \(error)")
|
|
235
232
|
throw error
|
|
@@ -240,7 +237,6 @@ public class ExpoIapModule: Module {
|
|
|
240
237
|
guard let productStore = self.productStore else {
|
|
241
238
|
return false
|
|
242
239
|
}
|
|
243
|
-
|
|
244
240
|
await productStore.removeAll()
|
|
245
241
|
self.transactions.removeAll()
|
|
246
242
|
self.productStore = nil
|
|
@@ -281,7 +277,6 @@ public class ExpoIapModule: Module {
|
|
|
281
277
|
{
|
|
282
278
|
addTransaction(transaction: transaction)
|
|
283
279
|
}
|
|
284
|
-
|
|
285
280
|
case .nonRenewable:
|
|
286
281
|
if await self.productStore?.getProduct(productID: transaction.productID)
|
|
287
282
|
!= nil
|
|
@@ -293,7 +288,6 @@ public class ExpoIapModule: Module {
|
|
|
293
288
|
addTransaction(transaction: transaction)
|
|
294
289
|
}
|
|
295
290
|
}
|
|
296
|
-
|
|
297
291
|
default:
|
|
298
292
|
break
|
|
299
293
|
}
|
|
@@ -385,16 +379,14 @@ public class ExpoIapModule: Module {
|
|
|
385
379
|
return nil
|
|
386
380
|
} else {
|
|
387
381
|
self.transactions[String(transaction.id)] = transaction
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
return
|
|
382
|
+
let serialized = serializeTransaction(transaction)
|
|
383
|
+
self.sendEvent(IapEvent.PurchaseUpdated, serialized)
|
|
384
|
+
return serialized
|
|
391
385
|
}
|
|
392
|
-
|
|
393
386
|
case .userCancelled:
|
|
394
387
|
throw NSError(
|
|
395
388
|
domain: "ExpoIapModule", code: 3,
|
|
396
389
|
userInfo: [NSLocalizedDescriptionKey: "User cancelled the purchase"])
|
|
397
|
-
|
|
398
390
|
case .pending:
|
|
399
391
|
throw NSError(
|
|
400
392
|
domain: "ExpoIapModule", code: 4,
|
|
@@ -676,10 +668,9 @@ public class ExpoIapModule: Module {
|
|
|
676
668
|
let transaction = try self.checkVerified(result)
|
|
677
669
|
self.transactions[String(transaction.id)] = transaction
|
|
678
670
|
if self.hasListeners {
|
|
679
|
-
|
|
680
|
-
self.sendEvent(
|
|
681
|
-
|
|
682
|
-
["transaction": serializeTransaction(transaction)])
|
|
671
|
+
let serialized = serializeTransaction(transaction)
|
|
672
|
+
self.sendEvent(IapEvent.PurchaseUpdated, serialized)
|
|
673
|
+
self.sendEvent(IapEvent.TransactionIapUpdated, ["transaction": serialized])
|
|
683
674
|
}
|
|
684
675
|
} catch {
|
|
685
676
|
if self.hasListeners {
|
|
@@ -717,7 +708,6 @@ public class ExpoIapModule: Module {
|
|
|
717
708
|
switch result {
|
|
718
709
|
case .unverified(_, let error):
|
|
719
710
|
throw error
|
|
720
|
-
|
|
721
711
|
case .verified(let item):
|
|
722
712
|
return item
|
|
723
713
|
}
|
package/package.json
CHANGED
package/src/ExpoIap.types.ts
CHANGED