My question is, on Android, does the p.purchase() method fire the implemented method (for non-consumable IAPs), in the main class, below, or is this just IOS?
@Override
public void itemPurchased(String sku) {
Background info: My app uses non-consumable in-app purchases, and is released to IOS and Android. I store the IAP 'receipt' in my cloud database so i know if they have purchased the full version or not. If they have not purchased it then after x days use then it will prompt them on entry, before issuing the IAP purchase logic.
public void askAndProcessMainIap() {
if (Dialog.show("", "Your trial period has finished. Please upgrade to the Full Version", "Ok", null)) {
Purchase p = Purchase.getInAppPurchase();
p.purchase("main_app_iap_paid");
}
On IOS all works, but on Android all my customers are reporting it not working - they are able to purchase the IAP from Google and the Google receipt does find the correct non-consumable IAP (as i have seen the name of it in screenshots). But my app is not storing the 'receipt' in my database. So when they go back into the app it asks them again, and then issues an error that they have already purchased it.
I need the itemPurchased() method to fire as this stores the database receipt entry. I ask this as the CN1 javadoc for the purchase() method says 'On Android you must use subscribe(java.lang.String) for play store subscription products'.
For ref, my build hints for android.nonconsumable should be correct as it is finding the Google Play IAP display name ok. Users aren't reporting any errors when they first make the purchase. Thanks
itemPurchasedcallback? Are any callbacks invoked? Does it work correctly on the simulator? - Shai Almog