wei-spring / codenameone

Automatically exported from code.google.com/p/codenameone
0 stars 0 forks source link

wasPurchased always returns false #1410

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
I encountered the problem that wasPurchased always returns false, even for 
(managed) products that I have successfully bought.

What steps will reproduce the problem?
1. create a managed non-consumable in-app product
2. buy the product
3. call wasPurchased to find out whether you bought the product

What is the expected output? What do you see instead?
I would expect the method to return true for bought products.
But I always get false, also for successfully bought products.

What version of the product are you using? On what operating system?
libVersion=84
iOS 8.1.3 on iPhone 5

Please provide any additional information below.
When I try to buy an already bought product, I get the message that I have 
already bought it and if I want to restore it for free. But still, wasPurchased 
returns false for this product

Original issue reported on code.google.com by tom2.ar...@gmail.com on 23 Mar 2015 at 6:14

GoogleCodeExporter commented 8 years ago

Original comment by shai.almog on 24 Mar 2015 at 5:22

GoogleCodeExporter commented 8 years ago
This seems to be a long-lasting problem with iOS... 

Original comment by brizi...@gmail.com on 24 Mar 2015 at 11:41

GoogleCodeExporter commented 8 years ago
Fixed in SVN.
https://code.google.com/p/codenameone/source/detail?r=2225

Will be included with next server update (probably next couple of days).

Original comment by st...@weblite.ca on 24 Mar 2015 at 11:21

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I have tested the fix on my iPhone and now, Purchase.wasPurchased works fine.
Also, Purchase.restore now works again.
Many thanks for the fast fix!

I have one suggestion:
It seems that Purchase.wasPurchased only returns true if the product has been 
bought on the very device or if Purchase.restore was called. So, 
Purchase.wasPurchased does not get the info directly from the store but rather 
when PurchaseCallback.itemPurchased or RestoreCallback.itemRestored is called.
Maybe, this could be documented in the JavaDoc ?

Original comment by tom2.ar...@gmail.com on 30 Mar 2015 at 7:41