expo-iap 2.9.7 → 3.0.0

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 +30 -0
  2. package/README.md +1 -1
  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 +38 -24
  42. package/plugin/build/withLocalOpenIAP.d.ts +6 -2
  43. package/plugin/build/withLocalOpenIAP.js +175 -20
  44. package/plugin/src/withIAP.ts +66 -30
  45. package/plugin/src/withLocalOpenIAP.ts +228 -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,35 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 3.0.0 - 2025-09-13
4
+
5
+ Breaking changes:
6
+
7
+ - Remove legacy APIs: `getProducts`, `getSubscriptions`, `requestProducts`, `requestSubscription`, `getPurchaseHistory`/`getPurchaseHistories`, and non‑suffixed iOS aliases
8
+ - `showManageSubscriptionsIOS()` now returns `Promise<Purchase[]>` (was `boolean`)
9
+ - `getAvailablePurchases()` options now only accept iOS keys: `alsoPublishToEventListenerIOS`, `onlyIncludeActiveItemsIOS`
10
+
11
+ Features:
12
+
13
+ - Unify tokens via `purchaseToken` on `Purchase` (iOS JWS + Android token)
14
+ - Add `getReceiptDataIOS` alias for iOS receipt parity
15
+
16
+ Refactor:
17
+
18
+ - Remove deprecated comments/tests/mocks; simplify subscription dedup to `id`
19
+ - Clean up hook surface and examples to current API
20
+
21
+ Fixes:
22
+
23
+ - iOS parity and guards across native bridge and TS layer
24
+
25
+ Docs:
26
+
27
+ - Add v3 migration and update API pages to remove legacy helpers
28
+
29
+ Tests:
30
+
31
+ - Remove legacy specs; all root and example suites pass
32
+
3
33
  ## [2.9.7] - 2025-09-12
4
34
 
5
35
  ### 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
 
@@ -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.0.1"
62
+ }
58
63
  }