Open patrickhofer opened 7 years ago
Probably cause you're doing that on iOS, in which case you should use getReceipt(). The docs say you must call restorePurchases first, then getReceipt, although my code works fine just using getReceipt().
For Android you must use restorePurchases.
I am also getting this issue... Not sure its because I am on an alpha version but I am getting an empy array on Android... Purchases work fine and also .getProducts. Just checking that we can actually test restore purchases on android without publishing right?
Please include:
var productId = 'com.myapp.ads' inAppPurchase .restorePurchases(productId) .then(function (purchases) { console.log(purchases); / [{ transactionId: ... productId: ... state: ... date: ... }] / })
[find: function] length: 0 proto: Array[0]
non-consumable
6.5
Android 6.0
:( I'm only depending on this to release my app..
Same here buddy... @AlexDisler is it possible to have clarification on this issue? I tried purchasing not as a tester as well and data still returns blank. I also checked if I have the items in the orders list and there are so not sure what's the issue at this point as I tried looking at this issue outside the plugin because it could be an api issue but since not much users are complaining about it makes me wonder if my theory is right...
Same problem here, purchase works but restore returning an empty array. On iOS everything is working fine.
Guys, I don't have a phone to test, but if you could get a logcat (adb) it would be something.
Been awhile since I messed with IAPs; forgive me if I'm wrong.
Google Play Store only provides Managed Products and Subscriptions. When a Managed Product is consumed, it's totally gone on Android. It will never show in Restore Purchases even with other IAP libraries. You can store the IAP data on your own server, and use the Play Store API to get information on it. Many games like Clash of Clans won't restore your purchase data either, so it's important customers link their account to Facebook/User System.
It sounds like you are consuming the product, even if unintentionally. I'd verify your code to ensure it's not consuming it. If it's not consumed, restore purchase will return so long as the authorization is correct.
Consumption is intended to work like: 1) Purchase 2) Send to your server to verify it and store it 3) Respond to the app as "successful verify", so it can then consume it. Now it's gone. If the user lost connection right as they did the purchase, it would never get consumed.
Okay, but what about subscriptions? It should at least return the purchase code for verification. But data comes [ ]
Subscriptions will always return. Were you able to complete a subscription, but cannot restore it?
If it's not, I'd question if your purchase is actually completing. Are you getting a transaction number?
The only thing that comes as response is "[ ]" on a subscription. A blank array.
jersobh, you get a blank array on restorePurchases, but do you get the blank array for the purchase itself?
If the purchase is a blank array, the permissions on the Play Store in-app-purchase are probably configured wrong. For example, the IAP is not live.
If the purchase returns, and the restore purchase is blank, then this is strange. As I said, confirm that the purchase transaction is actually returning a transaction ID. Do you have a full object for this that you can paste? Can exclude app details.
@caleb87 the purchase returns, and the restore purchase is blank for me too. I have tested this over and over with actual paid and testing ids and I saw this issue in various other comments as ref above.
I do get a full array on purchase but on restore I get []. My code is the same as @jersobh with the difference that I use Managed Purchases. I fail to believe that I have to host this from my side as the user has the purchase data on their account which stays in the history and this is what the array should return.
Something is wrong with the restore call unless you have it working and can share some code?
for me is a empty array and i trying with android and ios :(
Hello, If you consume product then its never display in restore product. So you have to use just buy method, not use consume method, caused consumable product is always purchased new its never display in restore purchase. If you want to use one product for life time then that product known as non-consumable product and its will also display in restore purchase list.
Thanks
The variable data always returns an empty array. With this code the inapp purchases are always restored. This should not be the case.
Can someone give me an example how I should implement inapp purchases with this plugin and ionic?