Skip to content
This repository was archived by the owner on Oct 16, 2025. It is now read-only.

Commit 3e03345

Browse files
authored
chore: update openiap-gql to 1.0.11 with type improvements (#17)
## Summary Updates openiap-gql dependency from 1.0.9 to 1.0.11, bringing improved type definitions with public initializers and new fields for alternative billing support. - **Type System Improvements**: Regenerated `Types.swift` with 19 new public initializers for Input types, eliminating cross-module initialization issues - **Alternative Billing Support**: Added `AlternativeBillingModeAndroid` enum and `InitConnectionConfig` struct - **Enhanced Transaction Handling**: Improved ObjC bridge to use actual transaction data from pending transactions - **Field Naming Updates**: Renamed `externalPurchaseUrlOnIOS` → `externalPurchaseUrl` for consistency ## Changes ### Dependencies - Updated `openiap-gql` from 1.0.9 to 1.0.11 in `openiap-versions.json` ### Code Generation - Fixed `generate-types.sh` script to properly copy generated files - Regenerated `Sources/Models/Types.swift` with latest schema ### New Types & Fields - `AlternativeBillingModeAndroid` enum (iOS alternative billing mode support) - `InitConnectionConfig` struct (connection configuration) - `ActiveSubscription`: Added `currentPlanId`, `basePlanIdAndroid`, `purchaseTokenAndroid` fields ### API Changes - `externalPurchaseUrlOnIOS` → `externalPurchaseUrl` (breaking change) - All Input types now have public initializers (improved DX for cross-module usage) ### Implementation Improvements - **`OpenIapModule+ObjC.swift`**: Enhanced `finishTransactionWithPurchaseId` to fetch actual transaction data from pending transactions before falling back to minimal data - **`OpenIapSerialization.swift`**: Added helper methods for creating Input types: - `requestSubscriptionIosProps()` - `requestPurchaseIosProps()` - `requestSubscriptionPropsByPlatforms()` - `requestPurchasePropsByPlatforms()` - **`Example/AlternativeBillingScreen.swift`**: Simplified to use direct initialization with new public initializers ## Breaking Changes ⚠️ **Field Rename**: `externalPurchaseUrlOnIOS` → `externalPurchaseUrl` Update any code using this field: ```swift // Before let url = props.externalPurchaseUrlOnIOS // After let url = props.externalPurchaseUrl ``` ## Test Plan - [x] swift test - All 10 tests passing - [x] swift build - Package builds successfully - [x] Example app builds and runs without errors - [x] Alternative billing flow works correctly - [x] Transaction finishing uses actual transaction data when available
1 parent 5fab0a7 commit 3e03345

File tree

7 files changed

+261
-46
lines changed

7 files changed

+261
-46
lines changed

Example/OpenIapExample/Screens/AlternativeBillingScreen.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -329,22 +329,20 @@ struct AlternativeBillingScreen: View {
329329
let request: RequestPurchaseProps.Request
330330
if requestType == .subs {
331331
let subscriptionProps = RequestSubscriptionIosProps(
332-
externalPurchaseUrlOnIOS: externalUrl,
332+
externalPurchaseUrl: externalUrl,
333333
sku: product.id
334334
)
335335

336336
request = .subscription(RequestSubscriptionPropsByPlatforms(
337-
android: nil,
338337
ios: subscriptionProps
339338
))
340339
} else {
341340
let iosProps = RequestPurchaseIosProps(
342-
externalPurchaseUrlOnIOS: externalUrl,
341+
externalPurchaseUrl: externalUrl,
343342
sku: product.id
344343
)
345344

346345
request = .purchase(RequestPurchasePropsByPlatforms(
347-
android: nil,
348346
ios: iosProps
349347
))
350348
}

0 commit comments

Comments
 (0)