Mourad Tlili
Mourad Tlili

Reputation: 31

Why am I getting an empty transaction history from Apple's new StoreKit2 endpoint?

I'm working on a React Native app and using the following libraries to handle in-app purchases and subscriptions:

Purchase management: react-native-iap

Transaction verification on server side: apple-store-server-api

I'm using the new StoreKit2 API endpoint for subscription retrieval , and I’ve been able to successfully reach the endpoint. However, I'm encountering an issue:

Problem

When I use getTransactionHistory or getTransactionInfo with the Apple Store Server API, I always get an empty array of transactions.

This happens despite the fact that: The purchase is successful in the sandbox environment. I can see the transaction in StoreKit Test in Xcode, and it has an expiry date. The transaction in the sandbox provides a transactionId, which I’m using to query the API.

What I Tried

I tested with sandbox:

The purchase completes successfully, and I get a transactionId from the sandbox. When I send this transactionId to the Apple Store Server API (using getTransactionHistory or getTransactionInfo), I receive an empty array. I tested with StoreKit Test:

Using StoreKit Test in Xcode, I can verify that the transaction is marked as finished and has an expiry date. However, since StoreKit Test doesn’t generate a valid transactionId, I cannot test it with the Apple endpoint.

Environment

React Native app using react-native-iap. Backend powered by the apple-store-server-api library. Testing in both sandbox and StoreKit Test environments. The subscription is configured correctly in my StoreKit configuration file and Apple Developer account.

Questions

Any help or guidance would be greatly appreciated!

Upvotes: 0

Views: 74

Answers (0)

Related Questions