Skip to content
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

originalTransactionIdentifierIOS typed as string | undefined, but returns a float number #2840

Open
oscklm opened this issue Sep 5, 2024 · 0 comments

Comments

@oscklm
Copy link

oscklm commented Sep 5, 2024

Please use the Discussion board if you want to get some help. Please use issues to report bugs.

Description

purchase.originalTransactionIdentifierIOS returns as a float number like 2000000706152106.0

Expected Behavior

originalTransactionIdentifierIOS is typed to be string | undefined

export interface SubscriptionPurchase extends ProductPurchase {
  autoRenewingAndroid?: boolean;
  originalTransactionDateIOS?: number;
  originalTransactionIdentifierIOS?: string;
  verificationResultIOS?: string;
  transactionReasonIOS?: TransactionReason | string;
}

Environment:

  • react-native-iap: ^12.15.2
  • react-native: 0.74.5
  • Platforms (iOS, Android, emulator, simulator, device): IOS

To Reproduce
In my case im experiencing it when doing this:

 const purchaseSubscription = async (sku: string) => {
    await requestSubscription({ sku, appAccountToken: user._id, isOfferPersonalized: false })
      .then(async (purchase) => {
        if (purchase) {
          if (!Array.isArray(purchase)) {
            // Handle the purchase being updated
            await finishTransaction({ purchase, isConsumable: false });
            setTransactionId(purchase.originalTransactionIdentifierIOS ?? null); // Sets the transactionId to a float value
          }
        }
      })
      .catch((error) => {
        console.log(error);
      });
  };

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant