You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Platforms you faced the error (IOS or Android or both?)
Android
Expected behavior
See each purchases item once in the return value
Actual behavior
See each purchase twice with one differing key
Tested environment (Emulator? Real Device?)
Real device
Steps to reproduce the behavior
Purchase an item on Android and print the getAvailablePurchases on startup.
When I make a call to the getAvailablePurchases, I get two entries in the array although I only made a single purchase. The product ID and a couple of other tokens are also the same in the two entries. Below is a sample response from getAvailablePurchases.
One call is to queryPurchases which appears to be synchronous and another call to queryPurchaseHistoryAsync which is asynchronous and the promise is resolved in the latter call. Some of the keys differ when entries are added for each call which can be seen in the response.
Could you please let me know why are these entries added twice and if I should ignore one type of entries?
Secondly, when I make a call to consumeAllItemsAndroid and call getAvailablePurchases after that, I still get one entry which is from the latter asynchronous call. Please clarify on these return values.
The text was updated successfully, but these errors were encountered:
I can confirm this problem. For me there are 2 entries in getAvailablePurchases after calling requestSubscription. Response data is similar to data in the message above.
Version of react-native-iap
3.0.0
Version of react-native
0.59.9
Platforms you faced the error (IOS or Android or both?)
Android
Expected behavior
See each purchases item once in the return value
Actual behavior
See each purchase twice with one differing key
Tested environment (Emulator? Real Device?)
Real device
Steps to reproduce the behavior
Purchase an item on Android and print the
getAvailablePurchases
on startup.When I make a call to the
getAvailablePurchases
, I get two entries in the array although I only made a single purchase. The product ID and a couple of other tokens are also the same in the two entries. Below is a sample response fromgetAvailablePurchases
.I looked at the code and I do see that we are making two calls to get the purchases here:
https://github.com/dooboolab/react-native-iap/blob/d6e9aa0c7c90bab5e65586f942dae0c4289e26ab/android/src/main/java/com/dooboolab/RNIap/RNIapModule.java#L271
One call is to
queryPurchases
which appears to be synchronous and another call toqueryPurchaseHistoryAsync
which is asynchronous and the promise is resolved in the latter call. Some of the keys differ when entries are added for each call which can be seen in the response.Could you please let me know why are these entries added twice and if I should ignore one type of entries?
Secondly, when I make a call to
consumeAllItemsAndroid
and callgetAvailablePurchases
after that, I still get one entry which is from the latter asynchronous call. Please clarify on these return values.The text was updated successfully, but these errors were encountered: