dooboolab-community / react-native-iap

In App Purchase module for React Native!
https://react-native-iap.dooboolab.com
MIT License
2.75k stars 632 forks source link

how to validate if a user buy a product and change his device.. #1268

Closed hafeez-ullah-khan closed 3 years ago

hafeez-ullah-khan commented 3 years ago

how to check if a user purchased a product ..but later on he/she change his/her phone and in that case how to validate that he/she already purchased or not from his new phone?

Version of react-native-iap ^5.2.7

Version of react-native 0.63.4

Platforms you faced the error (IOS or Android or both?)

codal-hkrishnani commented 3 years ago

@hafeez-ullah-khan for that you need to keep track of your purchases in your own server, for iOS you may validate without server by using this method validateReceiptIos But having your own Server is recommended

indapublic commented 3 years ago

when iphone is changed, appleid should be same. are you asking about products or subscriptions?

hafeez-ullah-khan commented 3 years ago

@hafeez-ullah-khan for that you need to keep track of your purchases in your own server, for iOS you may validate without server by using this method validateReceiptIos But having your own Server is recommended

i have only one product, and how can i validate that in android? if the the userer purchased that product, but later on he change his phone ,at that time how to check if the user has purchased or not?

hafeez-ullah-khan commented 3 years ago

when iphone is changed, appleid should be same. are you asking about products or subscriptions? i am asking about product, and plateform is for now android?

codal-hkrishnani commented 3 years ago

@hafeez-ullah-khan for that you need to keep track of your purchases in your own server, for iOS you may validate without server by using this method validateReceiptIos But having your own Server is recommended

i have only one product, and how can i validate that in android? if the the userer purchased that product, but later on he change his phone ,at that time how to check if the user has purchased or not?

For Android it's not possible to check without server. you have to have server in order to validate android receipt.

hyochan commented 3 years ago

Yes @codal-hkrishnani is right. Logically, you need to match with some unique userId so that the purchased items can be tracked.