Skip to content

fix(ios): serialize UInt64 transaction IDs as strings to prevent E_DEVELOPER_ERROR during finishTransaction #2931

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ios/IapSerializationUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,12 @@ func serialize(_ t: Transaction) -> [String: Any?] {
"deviceVerificationNonce": t.deviceVerificationNonce.uuidString,
"expirationDate": t.expirationDate?.millisecondsSince1970,
"environment": environment,
"id": t.id,
"id": String(t.id),
"isUpgraded": t.isUpgraded,
"jsonRepresentation": serialize(t.jsonRepresentation),
"offerID": t.offerID,
"offerType": serialize(t.offerType),
"originalID": t.originalID,
"originalID": String(t.originalID),
"originalPurchaseDate": t.originalPurchaseDate.millisecondsSince1970,
"ownershipType": serialize(t.ownershipType),
"productID": t.productID,
Expand Down
4 changes: 2 additions & 2 deletions src/types/appleSk2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export type TransactionSk2 = {
deviceVerificationNonce: string;
expirationDate: number;
environment?: 'Production' | 'Sandbox' | 'Xcode'; // Could be undefined in some cases on iOS 15, but it's stable since iOS 16
id: number;
id: string;
isUpgraded: boolean;
jsonRepresentation: string;
offerID: string;
Expand Down Expand Up @@ -189,7 +189,7 @@ export const transactionSk2ToPurchaseMap = ({
}
const purchase: Purchase = {
productId: productID,
transactionId: String(id),
transactionId: id,
transactionDate: purchaseDate, //??
transactionReceipt: '', // Not available
purchaseToken: '', //Not available
Expand Down
Loading