expo-iap 2.9.7 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/README.md +10 -2
  3. package/android/build.gradle +7 -2
  4. package/android/src/main/java/expo/modules/iap/ExpoIapModule.kt +195 -650
  5. package/android/src/main/java/expo/modules/iap/PromiseUtils.kt +85 -0
  6. package/build/ExpoIap.types.d.ts +0 -6
  7. package/build/ExpoIap.types.d.ts.map +1 -1
  8. package/build/ExpoIap.types.js.map +1 -1
  9. package/build/helpers/subscription.d.ts.map +1 -1
  10. package/build/helpers/subscription.js +14 -3
  11. package/build/helpers/subscription.js.map +1 -1
  12. package/build/index.d.ts +6 -73
  13. package/build/index.d.ts.map +1 -1
  14. package/build/index.js +21 -154
  15. package/build/index.js.map +1 -1
  16. package/build/modules/android.d.ts +2 -2
  17. package/build/modules/android.d.ts.map +1 -1
  18. package/build/modules/android.js +11 -1
  19. package/build/modules/android.js.map +1 -1
  20. package/build/modules/ios.d.ts +0 -60
  21. package/build/modules/ios.d.ts.map +1 -1
  22. package/build/modules/ios.js +2 -121
  23. package/build/modules/ios.js.map +1 -1
  24. package/build/types/ExpoIapAndroid.types.d.ts +0 -8
  25. package/build/types/ExpoIapAndroid.types.d.ts.map +1 -1
  26. package/build/types/ExpoIapAndroid.types.js +0 -1
  27. package/build/types/ExpoIapAndroid.types.js.map +1 -1
  28. package/build/types/ExpoIapIOS.types.d.ts +0 -5
  29. package/build/types/ExpoIapIOS.types.d.ts.map +1 -1
  30. package/build/types/ExpoIapIOS.types.js.map +1 -1
  31. package/build/useIAP.d.ts +0 -18
  32. package/build/useIAP.d.ts.map +1 -1
  33. package/build/useIAP.js +1 -18
  34. package/build/useIAP.js.map +1 -1
  35. package/bun.lock +340 -137
  36. package/codecov.yml +17 -21
  37. package/ios/ExpoIapModule.swift +10 -3
  38. package/jest.config.js +5 -9
  39. package/package.json +5 -3
  40. package/plugin/build/withIAP.d.ts +4 -1
  41. package/plugin/build/withIAP.js +48 -28
  42. package/plugin/build/withLocalOpenIAP.d.ts +6 -2
  43. package/plugin/build/withLocalOpenIAP.js +179 -20
  44. package/plugin/src/withIAP.ts +81 -37
  45. package/plugin/src/withLocalOpenIAP.ts +232 -24
  46. package/src/ExpoIap.types.ts +0 -8
  47. package/src/helpers/subscription.ts +14 -3
  48. package/src/index.ts +22 -230
  49. package/src/modules/android.ts +16 -6
  50. package/src/modules/ios.ts +2 -168
  51. package/src/types/ExpoIapAndroid.types.ts +0 -11
  52. package/src/types/ExpoIapIOS.types.ts +0 -5
  53. package/src/useIAP.ts +3 -55
  54. package/android/src/main/java/expo/modules/iap/PlayUtils.kt +0 -178
  55. package/android/src/main/java/expo/modules/iap/Types.kt +0 -98
package/CHANGELOG.md CHANGED
@@ -1,5 +1,41 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 3.0.1 - 2025-09-13
4
+
5
+ - Android: Ensure `openiap-google:1.1.0` is added inside `dependencies {}` and replace/dedupe existing entries. In local dev, remove the Maven line and rely on `project(':openiap-google')`. Library fallback bumped to 1.1.0.
6
+ - iOS: Honor `enableLocalDev: false` even when `localPath` is set. Ensure CocoaPods CDN in Podfile and remove any stale local `pod 'openiap', :path => ...` lines.
7
+ - Misc: Drop legacy Billing/GMS cleanup patterns, simplify prebuild logs, and add a short release blog post.
8
+
9
+ ## 3.0.0 - 2025-09-13
10
+
11
+ Breaking changes:
12
+
13
+ - Remove legacy APIs: `getProducts`, `getSubscriptions`, `requestProducts`, `requestSubscription`, `getPurchaseHistory`/`getPurchaseHistories`, and non‑suffixed iOS aliases
14
+ - `showManageSubscriptionsIOS()` now returns `Promise<Purchase[]>` (was `boolean`)
15
+ - `getAvailablePurchases()` options now only accept iOS keys: `alsoPublishToEventListenerIOS`, `onlyIncludeActiveItemsIOS`
16
+
17
+ Features:
18
+
19
+ - Unify tokens via `purchaseToken` on `Purchase` (iOS JWS + Android token)
20
+ - Add `getReceiptDataIOS` alias for iOS receipt parity
21
+
22
+ Refactor:
23
+
24
+ - Remove deprecated comments/tests/mocks; simplify subscription dedup to `id`
25
+ - Clean up hook surface and examples to current API
26
+
27
+ Fixes:
28
+
29
+ - iOS parity and guards across native bridge and TS layer
30
+
31
+ Docs:
32
+
33
+ - Add v3 migration and update API pages to remove legacy helpers
34
+
35
+ Tests:
36
+
37
+ - Remove legacy specs; all root and example suites pass
38
+
3
39
  ## [2.9.7] - 2025-09-12
4
40
 
5
41
  ### Changed
package/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  <div align="center">
4
4
  <img src="https://hyochan.github.io/expo-iap/img/icon.png" alt="Expo IAP Logo" width="150" />
5
5
 
6
- [![Version](http://img.shields.io/npm/v/expo-iap.svg?style=flat-square)](https://npmjs.org/package/expo-iap) [![Download](http://img.shields.io/npm/dm/expo-iap.svg?style=flat-square)](https://npmjs.org/package/expo-iap) [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fhyochan%2Fexpo-iap.svg?type=shield&issueType=license)](https://app.fossa.com/projects/git%2Bgithub.com%2Fhyochan%2Fexpo-iap?ref=badge_shield&issueType=license)
6
+ [![Version](http://img.shields.io/npm/v/expo-iap.svg?style=flat-square)](https://npmjs.org/package/expo-iap) [![Download](http://img.shields.io/npm/dm/expo-iap.svg?style=flat-square)](https://npmjs.org/package/expo-iap) [![CI](https://github.com/hyochan/expo-iap/actions/workflows/ci.yml/badge.svg)](https://github.com/hyochan/expo-iap/actions/workflows/ci.yml) [![codecov](https://codecov.io/gh/hyochan/expo-iap/graph/badge.svg?token=47VMTY5NyM)](https://codecov.io/gh/hyochan/expo-iap) [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fhyochan%2Fexpo-iap.svg?type=shield&issueType=license)](https://app.fossa.com/projects/git%2Bgithub.com%2Fhyochan%2Fexpo-iap?ref=badge_shield&issueType=license)
7
7
 
8
8
  In app purchase module in [Expo](https://docs.expo.dev/guides/in-app-purchases) that conforms to the [Open IAP specification](https://openiap.dev)
9
9
 
@@ -16,7 +16,15 @@
16
16
 
17
17
  ## Notice
18
18
 
19
- The `expo-iap` module has been migrated from [react-native-iap](https://github.com/dooboolab/react-native-iap). Moving forward, the `react-native-iap` repository will gradually be deprecated, and `expo-iap` will become the actively maintained module. Please take note of this transition. For more details, refer to the [Future Roadmap and Discussion in react-native-iap](https://github.com/dooboolab-community/react-native-iap/discussions/2754). Additionally, you can check the [Current Project Status comment](https://github.com/dooboolab-community/react-native-iap/discussions/2754#discussioncomment-10510249) to stay updated on the project's progress.
19
+ The `expo-iap` module has been migrated from [react-native-iap](https://github.com/dooboolab/react-native-iap). While we initially considered fully merging everything into `react-native-iap`, we ultimately decided to maintain the two libraries in parallel, each tailored to its own ecosystem.
20
+
21
+ - **`react-native-iap`** → a **Nitro Modules–based** implementation for React Native.
22
+ - **`expo-iap`** → an **Expo Module** with tighter integration and smoother compatibility in the Expo ecosystem.
23
+
24
+ Both libraries will continue to be maintained in parallel going forward.
25
+
26
+ 📖 See the [Future Roadmap and Discussion](https://github.com/dooboolab-community/react-native-iap/discussions/2754) for more details.
27
+ 👉 Stay updated via the [Current Project Status comment](https://github.com/dooboolab-community/react-native-iap/discussions/2754#discussioncomment-10510249).
20
28
 
21
29
  ## Installation
22
30
 
@@ -53,6 +53,11 @@ android {
53
53
 
54
54
  dependencies {
55
55
  implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7"
56
- implementation "com.android.billingclient:billing-ktx:8.0.0"
57
- implementation "com.google.android.gms:play-services-base:18.1.0"
56
+ // Use OpenIAP Google module only; avoid direct BillingClient dependency
57
+ if (findProject(":openiap-google") != null) {
58
+ implementation project(":openiap-google")
59
+ } else {
60
+ // Fallback to published artifact when local project isn't linked
61
+ implementation "io.github.hyochan.openiap:openiap-google:1.1.0"
62
+ }
58
63
  }