Skip to content

Commit 63746f0

Browse files
authored
migration: integrate openiap-gql 1.0 type system (#209)
## Summary - unify exported types around the generated schema - align runtime helpers, hooks, and docs with the new definitions - applied [OpenIAP GQL 1.0](https://github.com/hyodotdev/openiap-gql/releases/tag/1.0.0) ## Testing - npm run lint:tsc - npm test - npm run build <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - deepLinkToSubscriptionsAndroid added. - useIAP option shouldAutoSyncPurchases introduced. - Centralized types expose ReceiptValidationResult and VoidResult; new PurchaseError surface for cross-platform error mapping. - **Refactor** - AppTransactionIOS renamed to AppTransaction; error codes standardized (removed E_ prefix). - getAvailablePurchases() is now no-arg. - finishTransaction now returns VoidResult | boolean; validateReceipt returns ReceiptValidationResult. - Subscription requests moved to platform-scoped props. - **Documentation** - Multiple docs and examples reformatted and updated to reflect API and naming changes. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent d807a2a commit 63746f0

40 files changed

+1448
-1617
lines changed

README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,18 @@
1414

1515
**[📖 Visit our comprehensive documentation site →](https://hyochan.github.io/expo-iap)**
1616

17-
1817
## Notice
1918

20-
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.
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.
2120

22-
- **`react-native-iap`** → a **Nitro Modules–based** implementation for React Native.
23-
- **`expo-iap`** → an **Expo Module** with tighter integration and smoother compatibility in the Expo ecosystem.
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.
2423

25-
Both libraries will continue to be maintained in parallel going forward.
24+
Both libraries will continue to be maintained in parallel going forward.
2625

2726
📖 See the [Future Roadmap and Discussion](https://github.com/dooboolab-community/react-native-iap/discussions/2754) for more details.
2827
👉 Stay updated via the [Current Project Status comment](https://github.com/dooboolab-community/react-native-iap/discussions/2754#discussioncomment-10510249).
2928

30-
3129
## Installation
3230

3331
```bash

docs/CONVENTIONS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ Platform-specific types:
190190

191191
- `ProductIOS`, `ProductAndroid`
192192
- `PurchaseErrorIOS`, `PurchaseErrorAndroid`
193-
- `AppTransactionIOS`, `SubscriptionOfferAndroid`
193+
- `AppTransaction`, `SubscriptionOfferAndroid`
194194

195195
Cross-platform types:
196196

docs/blog/2025-09-13-v3.0.1.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,3 @@ After prebuild
1717

1818
- iOS: Not seeing `pod 'openiap'` in your Podfile is expected; it’s pulled in via the Podspec.
1919
- Android: Exactly one `openiap-google:1.1.0` line inside `dependencies {}`. In local mode the Maven line is removed and `project(':openiap-google')` is used.
20-

docs/docs/api/error-codes.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -197,9 +197,7 @@ ErrorCodeUtils.getNativeErrorCode(errorCode: ErrorCode): string
197197
**Example**:
198198

199199
```tsx
200-
const nativeCode = ErrorCodeUtils.getNativeErrorCode(
201-
ErrorCode.UserCancelled,
202-
);
200+
const nativeCode = ErrorCodeUtils.getNativeErrorCode(ErrorCode.UserCancelled);
203201
console.log(nativeCode); // Platform-specific code
204202
```
205203

@@ -244,10 +242,7 @@ ErrorCodeUtils.toPlatformCode(
244242

245243
```tsx
246244
// iOS
247-
const iosCode = ErrorCodeUtils.toPlatformCode(
248-
ErrorCode.UserCancelled,
249-
'ios',
250-
);
245+
const iosCode = ErrorCodeUtils.toPlatformCode(ErrorCode.UserCancelled, 'ios');
251246
console.log(iosCode); // 2
252247

253248
// Android

docs/docs/api/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import AdFitTopFixed from "@site/src/uis/AdFitTopFixed";
77
Welcome to the Expo IAP API documentation. Here you'll find comprehensive guides and references for all the features and functionality available in Expo IAP.
88

99
Note: expo-iap follows the OpenIAP API model for consistency across platforms and SDKs. For the canonical API surface, see OpenIAP APIs:
10+
1011
- https://www.openiap.dev/docs/apis
1112

1213
## Available APIs

docs/docs/api/methods/core-methods.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ const completePurchase = async (purchase) => {
271271
- `purchase` (Purchase): The purchase object to finish
272272
- `isConsumable?` (boolean): Whether the product is consumable (Android)
273273

274-
**Returns:** `Promise<PurchaseResult | boolean>`
274+
**Returns:** `Promise<VoidResult | boolean>`
275275

276276
## getAvailablePurchases()
277277

@@ -707,10 +707,10 @@ const fetchAppTransaction = async () => {
707707
};
708708
```
709709

710-
**Returns:** `Promise<AppTransactionIOS | null>`
710+
**Returns:** `Promise<AppTransaction | null>`
711711

712712
```ts
713-
interface AppTransactionIOS {
713+
interface AppTransaction {
714714
appTransactionId?: string; // iOS 18.4+
715715
originalPlatform?: string; // iOS 18.4+
716716
bundleId: string;

0 commit comments

Comments
 (0)