iaphub / react-native-iaphub

The easiest way to implement IAP (In-app purchase) in your React Native app.
https://www.iaphub.com/
MIT License
319 stars 21 forks source link

User id different from the id used when filtering products in get purchases request #83

Closed BernardKintzing closed 3 years ago

BernardKintzing commented 3 years ago

When I creating an IAPHub user I assign a user id to them, this user id I have stored in my database. Later when I fetch all purchases, and sort by user https://api.iaphub.com/v1/app/:appId/purchases?user=:user using the user id I assigned, I get the error user_invalid. When I fetch a user https://api.iaphub.com/v1/app/:appId/user/:userId, I use the user id I assigned. Why is the :user different from the :userId I assigned.

I need to be able to fetch a users past subscriptions, the get user request only returns active products, not past products, and does not include the :user I need to sort for the get purchases request. Is there a way to get :user from :userId?

iaphub commented 3 years ago

Hi @BernardKintzing, You should use the userId property instead of the user property, we just added the property in the documentation, it was missing. 🙂

https://www.iaphub.com/docs/api/get-purchases