Error and Solution: Subscription/Purchase Issue on Android with react-native-iap #149532
Unanswered
diegoleondev
asked this question in
npm
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Error:
Possible Solution
In my case, I have an abstraction layer that standardizes the response for products across iOS, Android, and my backend.
The function I use consolidates these responses into the following unified structure:
When subscribing on iOS, everything works smoothly:
However, on Android, the error mentioned above occurs. This happens because the
requestSubscription
function in Android expects the group ID as thesku
, not the plan (or offer) ID. As a result, the purchase fails.To solve this issue, I added a
payload
property to the plan structure. This property contains the necessary information to perform a purchase on each platform.Conclusion
On Android, passing the offer ID as the
sku
inrequestSubscription
will result in an error. Instead, you need to pass the group ID, which is what Android requires to process the purchase.Beta Was this translation helpful? Give feedback.
All reactions