expo-iap 2.3.1-rc.4 → 2.3.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.
@@ -90,7 +90,6 @@ export type ProductPurchaseIos = PurchaseBase & {
90
90
  quantityIos?: number;
91
91
  originalTransactionDateIos?: number;
92
92
  originalTransactionIdentifierIos?: string;
93
- verificationResultIos?: string;
94
93
  appAccountToken?: string;
95
94
  expirationDateIos?: number;
96
95
  webOrderLineItemIdIos?: number;
@@ -1 +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,KAAK,qBAAqB,GAAG,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,MAAM,GAAG,EAAE,CAAC;AACpE,KAAK,WAAW,GAAG,EAAE,GAAG,WAAW,GAAG,YAAY,GAAG,YAAY,CAAC;AAElE,KAAK,iBAAiB,GAAG;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,WAAW,CAAC;IACzB,MAAM,EAAE,qBAAqB,CAAC;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,cAAc,GAAG,aAAa,CAAC;CACtC,CAAC;AAEF,KAAK,gBAAgB,GAAG;IACtB,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,iBAAiB,CAAC,EAAE,iBAAiB,EAAE,CAAC;IACxC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,kBAAkB,EAAE,qBAAqB,CAAC;CAC3C,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,WAAW,GAAG;IACrC,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,kBAAkB,EAAE,MAAM,C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,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ExpoIapIos.types.js","sourceRoot":"","sources":["../../src/types/ExpoIapIos.types.ts"],"names":[],"mappings":"","sourcesContent":["import {PurchaseBase, ProductBase} from '../ExpoIap.types';\n\ntype SubscriptionIosPeriod = 'DAY' | 'WEEK' | 'MONTH' | 'YEAR' | '';\ntype PaymentMode = '' | 'FREETRIAL' | 'PAYASYOUGO' | 'PAYUPFRONT';\n\ntype SubscriptionOffer = {\n displayPrice: string;\n id: string;\n paymentMode: PaymentMode;\n period: SubscriptionIosPeriod;\n periodCount: number;\n price: number;\n type: 'introductory' | 'promotional';\n};\n\ntype SubscriptionInfo = {\n introductoryOffer?: SubscriptionOffer;\n promotionalOffers?: SubscriptionOffer[];\n subscriptionGroupID: string;\n subscriptionPeriod: SubscriptionIosPeriod;\n};\n\nexport type ProductIos = ProductBase & {\n displayName: string;\n isFamilyShareable: boolean;\n jsonRepresentation: string;\n subscription: SubscriptionInfo;\n introductoryPriceNumberOfPeriodsIOS?: string;\n introductoryPriceSubscriptionPeriodIOS?: SubscriptionIosPeriod;\n};\n\nexport type Discount = {\n identifier: string;\n type: string;\n numberOfPeriods: string;\n price: string;\n localizedPrice: string;\n paymentMode: PaymentMode;\n subscriptionPeriod: string;\n};\n\nexport type SubscriptionProductIos = ProductIos & {\n discounts?: Discount[];\n introductoryPrice?: string;\n introductoryPriceAsAmountIOS?: string;\n introductoryPricePaymentModeIOS?: PaymentMode;\n introductoryPriceNumberOfPeriodsIOS?: string;\n introductoryPriceSubscriptionPeriodIOS?: SubscriptionIosPeriod;\n subscriptionPeriodNumberIOS?: string;\n subscriptionPeriodUnitIOS?: SubscriptionIosPeriod;\n};\n\nexport type PaymentDiscount = {\n /**\n * A string used to uniquely identify a discount offer for a product.\n */\n identifier: string;\n /**\n * A string that identifies the key used to generate the signature.\n */\n keyIdentifier: string;\n /**\n * A universally unique ID (UUID) value that you define.\n */\n nonce: string;\n /**\n * A UTF-8 string representing the properties of a specific discount offer, cryptographically signed.\n */\n signature: string;\n /**\n * The date and time of the signature's creation in milliseconds, formatted in Unix epoch time.\n */\n timestamp: number;\n};\n\nexport type RequestPurchaseIosProps = {\n sku: string;\n andDangerouslyFinishTransactionAutomaticallyIOS?: boolean;\n /**\n * UUID representing user account\n */\n appAccountToken?: string;\n quantity?: number;\n withOffer?: PaymentDiscount;\n};\n\nexport type RequestSubscriptionIosProps = RequestPurchaseIosProps;\n\ntype SubscriptionStatus =\n | 'expired'\n | 'inBillingRetryPeriod'\n | 'inGracePeriod'\n | 'revoked'\n | 'subscribed';\n\ntype RenewalInfo = {\n jsonRepresentation?: string;\n willAutoRenew: boolean;\n autoRenewPreference?: string;\n};\n\nexport type ProductStatusIos = {\n state: SubscriptionStatus;\n renewalInfo?: RenewalInfo;\n};\n\nexport type ProductPurchaseIos = PurchaseBase & {\n // iOS basic fields\n quantityIos?: number;\n originalTransactionDateIos?: number;\n originalTransactionIdentifierIos?: string;\n verificationResultIos?: string;\n appAccountToken?: string;\n // iOS additional fields from StoreKit 2\n expirationDateIos?: number;\n webOrderLineItemIdIos?: number;\n environmentIos?: string;\n storefrontCountryCodeIos?: string;\n appBundleIdIos?: string;\n productTypeIos?: string;\n subscriptionGroupIdIos?: string;\n isUpgradedIos?: boolean;\n ownershipTypeIos?: string;\n reasonIos?: string;\n reasonStringRepresentationIos?: string;\n transactionReasonIos?: 'PURCHASE' | 'RENEWAL' | string;\n revocationDateIos?: number;\n revocationReasonIos?: string;\n offerIos?: {\n id: string;\n type: string;\n paymentMode: string;\n };\n priceIos?: number;\n currencyIos?: string;\n jwsRepresentationIos?: string;\n};\n"]}
1
+ {"version":3,"file":"ExpoIapIos.types.js","sourceRoot":"","sources":["../../src/types/ExpoIapIos.types.ts"],"names":[],"mappings":"","sourcesContent":["import {PurchaseBase, ProductBase} from '../ExpoIap.types';\n\ntype SubscriptionIosPeriod = 'DAY' | 'WEEK' | 'MONTH' | 'YEAR' | '';\ntype PaymentMode = '' | 'FREETRIAL' | 'PAYASYOUGO' | 'PAYUPFRONT';\n\ntype SubscriptionOffer = {\n displayPrice: string;\n id: string;\n paymentMode: PaymentMode;\n period: SubscriptionIosPeriod;\n periodCount: number;\n price: number;\n type: 'introductory' | 'promotional';\n};\n\ntype SubscriptionInfo = {\n introductoryOffer?: SubscriptionOffer;\n promotionalOffers?: SubscriptionOffer[];\n subscriptionGroupID: string;\n subscriptionPeriod: SubscriptionIosPeriod;\n};\n\nexport type ProductIos = ProductBase & {\n displayName: string;\n isFamilyShareable: boolean;\n jsonRepresentation: string;\n subscription: SubscriptionInfo;\n introductoryPriceNumberOfPeriodsIOS?: string;\n introductoryPriceSubscriptionPeriodIOS?: SubscriptionIosPeriod;\n};\n\nexport type Discount = {\n identifier: string;\n type: string;\n numberOfPeriods: string;\n price: string;\n localizedPrice: string;\n paymentMode: PaymentMode;\n subscriptionPeriod: string;\n};\n\nexport type SubscriptionProductIos = ProductIos & {\n discounts?: Discount[];\n introductoryPrice?: string;\n introductoryPriceAsAmountIOS?: string;\n introductoryPricePaymentModeIOS?: PaymentMode;\n introductoryPriceNumberOfPeriodsIOS?: string;\n introductoryPriceSubscriptionPeriodIOS?: SubscriptionIosPeriod;\n subscriptionPeriodNumberIOS?: string;\n subscriptionPeriodUnitIOS?: SubscriptionIosPeriod;\n};\n\nexport type PaymentDiscount = {\n /**\n * A string used to uniquely identify a discount offer for a product.\n */\n identifier: string;\n /**\n * A string that identifies the key used to generate the signature.\n */\n keyIdentifier: string;\n /**\n * A universally unique ID (UUID) value that you define.\n */\n nonce: string;\n /**\n * A UTF-8 string representing the properties of a specific discount offer, cryptographically signed.\n */\n signature: string;\n /**\n * The date and time of the signature's creation in milliseconds, formatted in Unix epoch time.\n */\n timestamp: number;\n};\n\nexport type RequestPurchaseIosProps = {\n sku: string;\n andDangerouslyFinishTransactionAutomaticallyIOS?: boolean;\n /**\n * UUID representing user account\n */\n appAccountToken?: string;\n quantity?: number;\n withOffer?: PaymentDiscount;\n};\n\nexport type RequestSubscriptionIosProps = RequestPurchaseIosProps;\n\ntype SubscriptionStatus =\n | 'expired'\n | 'inBillingRetryPeriod'\n | 'inGracePeriod'\n | 'revoked'\n | 'subscribed';\n\ntype RenewalInfo = {\n jsonRepresentation?: string;\n willAutoRenew: boolean;\n autoRenewPreference?: string;\n};\n\nexport type ProductStatusIos = {\n state: SubscriptionStatus;\n renewalInfo?: RenewalInfo;\n};\n\nexport type ProductPurchaseIos = PurchaseBase & {\n // iOS basic fields\n quantityIos?: number;\n originalTransactionDateIos?: number;\n originalTransactionIdentifierIos?: string;\n appAccountToken?: string;\n // iOS additional fields from StoreKit 2\n expirationDateIos?: number;\n webOrderLineItemIdIos?: number;\n environmentIos?: string;\n storefrontCountryCodeIos?: string;\n appBundleIdIos?: string;\n productTypeIos?: string;\n subscriptionGroupIdIos?: string;\n isUpgradedIos?: boolean;\n ownershipTypeIos?: string;\n reasonIos?: string;\n reasonStringRepresentationIos?: string;\n transactionReasonIos?: 'PURCHASE' | 'RENEWAL' | string;\n revocationDateIos?: number;\n revocationReasonIos?: string;\n offerIos?: {\n id: string;\n type: string;\n paymentMode: string;\n };\n priceIos?: number;\n currencyIos?: string;\n jwsRepresentationIos?: string;\n};\n"]}
package/iap.md CHANGED
@@ -209,8 +209,8 @@ Transactions map to `Purchase` or `SubscriptionPurchase` with platform-specific
209
209
  Below is a simple example of fetching products and making a purchase with `expo-iap` in a managed workflow, updated to use the new `requestPurchase` signature:
210
210
 
211
211
  ```tsx
212
- import { useEffect, useState } from 'react';
213
- import { Button, Text, View } from 'react-native';
212
+ import {useEffect, useState} from 'react';
213
+ import {Button, Text, View} from 'react-native';
214
214
  import {
215
215
  initConnection,
216
216
  endConnection,
@@ -237,7 +237,7 @@ export default function SimpleIAP() {
237
237
 
238
238
  const purchaseListener = purchaseUpdatedListener(async (purchase) => {
239
239
  if (purchase) {
240
- await finishTransaction({ purchase, isConsumable: true });
240
+ await finishTransaction({purchase, isConsumable: true});
241
241
  alert('Purchase completed!');
242
242
  }
243
243
  });
@@ -252,12 +252,12 @@ export default function SimpleIAP() {
252
252
  const buyItem = async () => {
253
253
  if (!product) return;
254
254
  await requestPurchase({
255
- request: { skus: [product.id] }, // Android expects 'skus'; iOS would use 'sku'
255
+ request: {skus: [product.id]}, // Android expects 'skus'; iOS would use 'sku'
256
256
  });
257
257
  };
258
258
 
259
259
  return (
260
- <View style={{ flex: 1, justifyContent: 'center', alignItems: 'center' }}>
260
+ <View style={{flex: 1, justifyContent: 'center', alignItems: 'center'}}>
261
261
  <Text>{isConnected ? 'Connected' : 'Connecting...'}</Text>
262
262
  {product ? (
263
263
  <>
@@ -277,7 +277,7 @@ export default function SimpleIAP() {
277
277
  The `useIAP` hook simplifies managing in-app purchases. Below is an example updated to use the new `requestPurchase` signature:
278
278
 
279
279
  ```tsx
280
- import { useEffect, useState } from 'react';
280
+ import {useEffect, useState} from 'react';
281
281
  import {
282
282
  SafeAreaView,
283
283
  ScrollView,
@@ -289,12 +289,20 @@ import {
289
289
  InteractionManager,
290
290
  Alert,
291
291
  } from 'react-native';
292
- import { useIAP } from 'expo-iap';
293
- import type { ProductPurchase, SubscriptionProduct } from 'expo-iap';
292
+ import {useIAP} from 'expo-iap';
293
+ import type {ProductPurchase, SubscriptionProduct} from 'expo-iap';
294
294
 
295
295
  // Define SKUs
296
- const productSkus = ['cpk.points.1000', 'cpk.points.5000', 'cpk.points.10000', 'cpk.points.30000'];
297
- const subscriptionSkus = ['cpk.membership.monthly.bronze', 'cpk.membership.monthly.silver'];
296
+ const productSkus = [
297
+ 'cpk.points.1000',
298
+ 'cpk.points.5000',
299
+ 'cpk.points.10000',
300
+ 'cpk.points.30000',
301
+ ];
302
+ const subscriptionSkus = [
303
+ 'cpk.membership.monthly.bronze',
304
+ 'cpk.membership.monthly.silver',
305
+ ];
298
306
 
299
307
  // Define operations
300
308
  const operations = ['getProducts', 'getSubscriptions'] as const;
@@ -321,7 +329,10 @@ export default function IAPWithHook() {
321
329
 
322
330
  const initializeIAP = async () => {
323
331
  try {
324
- await Promise.all([getProducts(productSkus), getSubscriptions(subscriptionSkus)]);
332
+ await Promise.all([
333
+ getProducts(productSkus),
334
+ getSubscriptions(subscriptionSkus),
335
+ ]);
325
336
  setIsReady(true);
326
337
  } catch (error) {
327
338
  console.error('Error initializing IAP:', error);
@@ -389,7 +400,10 @@ export default function IAPWithHook() {
389
400
  <View style={styles.buttons}>
390
401
  <ScrollView contentContainerStyle={styles.buttonsWrapper} horizontal>
391
402
  {operations.map((operation) => (
392
- <Pressable key={operation} onPress={() => handleOperation(operation)}>
403
+ <Pressable
404
+ key={operation}
405
+ onPress={() => handleOperation(operation)}
406
+ >
393
407
  <View style={styles.buttonView}>
394
408
  <Text>{operation}</Text>
395
409
  </View>
@@ -401,10 +415,10 @@ export default function IAPWithHook() {
401
415
  {!isReady ? (
402
416
  <Text>Loading...</Text>
403
417
  ) : (
404
- <View style={{ gap: 12 }}>
405
- <Text style={{ fontSize: 20 }}>Products</Text>
418
+ <View style={{gap: 12}}>
419
+ <Text style={{fontSize: 20}}>Products</Text>
406
420
  {products.map((item) => (
407
- <View key={item.id} style={{ gap: 12 }}>
421
+ <View key={item.id} style={{gap: 12}}>
408
422
  <Text>
409
423
  {item.title} -{' '}
410
424
  {item.platform === 'android'
@@ -415,20 +429,24 @@ export default function IAPWithHook() {
415
429
  title="Buy"
416
430
  onPress={() =>
417
431
  requestPurchase({
418
- request: item.platform === 'android' ? { skus: [item.id] } : { sku: item.id },
432
+ request:
433
+ item.platform === 'android'
434
+ ? {skus: [item.id]}
435
+ : {sku: item.id},
419
436
  })
420
437
  }
421
438
  />
422
439
  </View>
423
440
  ))}
424
441
 
425
- <Text style={{ fontSize: 20 }}>Subscriptions</Text>
442
+ <Text style={{fontSize: 20}}>Subscriptions</Text>
426
443
  {subscriptions.map((item) => (
427
- <View key={item.id} style={{ gap: 12 }}>
444
+ <View key={item.id} style={{gap: 12}}>
428
445
  <Text>
429
446
  {item.title || item.displayName} -{' '}
430
447
  {item.platform === 'android' && item.subscriptionOfferDetails
431
- ? item.subscriptionOfferDetails[0]?.pricingPhases.pricingPhaseList[0].formattedPrice
448
+ ? item.subscriptionOfferDetails[0]?.pricingPhases
449
+ .pricingPhaseList[0].formattedPrice
432
450
  : item.displayPrice}
433
451
  </Text>
434
452
  <Button
@@ -445,7 +463,7 @@ export default function IAPWithHook() {
445
463
  offerToken: offer.offerToken,
446
464
  })) || [],
447
465
  }
448
- : { sku: item.id },
466
+ : {sku: item.id},
449
467
  type: 'subs',
450
468
  })
451
469
  }
@@ -232,12 +232,12 @@ public class ExpoIapModule: Module {
232
232
 
233
233
  AsyncFunction("getAvailableItems") {
234
234
  (alsoPublishToEventListener: Bool, onlyIncludeActiveItems: Bool) -> [[String: Any?]?] in
235
- var purchasedItems: [Transaction] = []
235
+ var purchasedItemsSerialized: [[String: Any?]] = []
236
236
 
237
- func addTransaction(transaction: Transaction) {
238
- purchasedItems.append(transaction)
237
+ func addTransaction(transaction: Transaction, jwsRepresentationIos: String? = nil) {
238
+ purchasedItemsSerialized.append(serializeTransaction(transaction, jwsRepresentationIos: jwsRepresentationIos))
239
239
  if alsoPublishToEventListener {
240
- self.sendEvent(IapEvent.PurchaseUpdated, serializeTransaction(transaction))
240
+ self.sendEvent(IapEvent.PurchaseUpdated, serializeTransaction(transaction, jwsRepresentationIos: jwsRepresentationIos))
241
241
  }
242
242
  }
243
243
 
@@ -247,13 +247,13 @@ public class ExpoIapModule: Module {
247
247
  }
248
248
  }
249
249
 
250
- for await result in onlyIncludeActiveItems
250
+ for await verification in onlyIncludeActiveItems
251
251
  ? Transaction.currentEntitlements : Transaction.all
252
252
  {
253
253
  do {
254
- let transaction = try self.checkVerified(result)
254
+ let transaction = try self.checkVerified(verification)
255
255
  if !onlyIncludeActiveItems {
256
- addTransaction(transaction: transaction)
256
+ addTransaction(transaction: transaction, jwsRepresentationIos: verification.jwsRepresentation)
257
257
  continue
258
258
  }
259
259
  switch transaction.productType {
@@ -261,7 +261,7 @@ public class ExpoIapModule: Module {
261
261
  if await self.productStore?.getProduct(productID: transaction.productID)
262
262
  != nil
263
263
  {
264
- addTransaction(transaction: transaction)
264
+ addTransaction(transaction: transaction, jwsRepresentationIos: verification.jwsRepresentation)
265
265
  }
266
266
  case .nonRenewable:
267
267
  if await self.productStore?.getProduct(productID: transaction.productID)
@@ -271,7 +271,7 @@ public class ExpoIapModule: Module {
271
271
  let expirationDate = Calendar(identifier: .gregorian).date(
272
272
  byAdding: DateComponents(year: 1), to: transaction.purchaseDate)!
273
273
  if currentDate < expirationDate {
274
- addTransaction(transaction: transaction)
274
+ addTransaction(transaction: transaction, jwsRepresentationIos: verification.jwsRepresentation)
275
275
  }
276
276
  }
277
277
  default:
@@ -298,7 +298,7 @@ public class ExpoIapModule: Module {
298
298
  }
299
299
  }
300
300
 
301
- return purchasedItems.map { serializeTransaction($0) }
301
+ return purchasedItemsSerialized
302
302
  }
303
303
 
304
304
  AsyncFunction("buyProduct") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "expo-iap",
3
- "version": "2.3.1-rc.4",
3
+ "version": "2.3.2",
4
4
  "description": "In App Purchase module in Expo",
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -109,7 +109,6 @@ export type ProductPurchaseIos = PurchaseBase & {
109
109
  quantityIos?: number;
110
110
  originalTransactionDateIos?: number;
111
111
  originalTransactionIdentifierIos?: string;
112
- verificationResultIos?: string;
113
112
  appAccountToken?: string;
114
113
  // iOS additional fields from StoreKit 2
115
114
  expirationDateIos?: number;