Problem with IAP - store.restore() quota?

hello,

we use admob to showing banners in app. and also we have working “no ads” button. It’s working fine, user can buy product. until it working fine.

we are checking payments store.restore() function at start app. First thing. Is it correct?

I read this

https://forums.coronalabs.com/topic/53489-how-can-i-use-refunded-state-with-new-google-in-app-v3/?p=314679

And now problem.

Sometime some paying customers (only paying) told us a problem with the fall down of the application after the startup. If we refund payment, app runs OK again. We tried find a problem. But it looks on some quota for restore function. We also tried ask users and most of them paid IAP in more then one of our apps (products) and they use both (or more) of our apps together. At start we are checking if user paid with store.restore() how we read on link above.

It’s possible we have something wrong, but we spend many time to detect and fix a problem and we definitelly need a help… Any ideas?

Thanks for any help or ideas.

it looks that one device try restore product too often. these people paid, apps work ok and one day both of apps crash down. after we refund payment, apps run ok again… It’s a few people, but it’s frustrating. Specially if they pay.

we have definitelly something wrong or we reached some quotas per device… I have no more ideas.

The Google IAP plugin used to wait until initialization was complete before it would continue to execute Corona code. However, that was creating “App Not Responding” errors with Google, so we recently (past 6 months) changed it to return and execute Corona code before initialization is complete.

Because network speeds will vary between users, you cannot safely call store.restore() immediately. You need to defer your store.restore() call until you get confirmation from your IAP listener that the initialization is complete. 

See: https://docs.coronalabs.com/plugin/google-iap-v3/init.html

Also, store.restore() is intended to give users an opportunity to restore purchases after they have deleted an app reinstalled it. If you decided to do this for Apple, they specifically require the store.restore() function be attached to a button action and not be automatically called.  It sounds like you may be using store.restore() as a way to get your purchases on every run. You should be managing previous purchases without using store.restore().  That is if the app is unlocked, save that information to a local file or using preferences (see:  When the app starts, use this information to determine if you need to unlock the app for the user and only use store.restore() if you detect the app has been deleted.

Rob

thanks a lot for your answer. local file is a solution, we were thinking about it. but how we can know if app was canceled or refunded? local file will exist and user can use it for free.

I hope I don’t invent wheel. I understand that store.restore() should be only for deleted app on button… but is there better way to identify if IAP is purchased?

btw: we fixed starting apps, dont fall down now. we correctly wait to listener. but if store.restore() doen’t work in some cases, users see ads… we are looking for some working solution. 

thanks again for your answer

You should get a “refunded” transaction event if the user requests a refund.  If they cancel while trying to purchase you will get a canceled event.

Rob

on Android we never got status “refunded” or “canceled” back in any event… It doesn’t work for us. What we should do? there is no way to check if product is refunded? we shouldn’t use store.restore(), but it works best from every things we tested.

What is best and correct practice?

is anywhere some example of these events for android? I tried searching, but didn’t find any solution.

If we use only local file, there are many refunds, how we read in forums. around 15% is unacceptable. people try refund and if it will works, they’ll tell to another people. We are still looking for some working solution for these cases.

thanks a lot for any help or answers…

it looks that one device try restore product too often. these people paid, apps work ok and one day both of apps crash down. after we refund payment, apps run ok again… It’s a few people, but it’s frustrating. Specially if they pay.

we have definitelly something wrong or we reached some quotas per device… I have no more ideas.

The Google IAP plugin used to wait until initialization was complete before it would continue to execute Corona code. However, that was creating “App Not Responding” errors with Google, so we recently (past 6 months) changed it to return and execute Corona code before initialization is complete.

Because network speeds will vary between users, you cannot safely call store.restore() immediately. You need to defer your store.restore() call until you get confirmation from your IAP listener that the initialization is complete. 

See: https://docs.coronalabs.com/plugin/google-iap-v3/init.html

Also, store.restore() is intended to give users an opportunity to restore purchases after they have deleted an app reinstalled it. If you decided to do this for Apple, they specifically require the store.restore() function be attached to a button action and not be automatically called.  It sounds like you may be using store.restore() as a way to get your purchases on every run. You should be managing previous purchases without using store.restore().  That is if the app is unlocked, save that information to a local file or using preferences (see:  When the app starts, use this information to determine if you need to unlock the app for the user and only use store.restore() if you detect the app has been deleted.

Rob

thanks a lot for your answer. local file is a solution, we were thinking about it. but how we can know if app was canceled or refunded? local file will exist and user can use it for free.

I hope I don’t invent wheel. I understand that store.restore() should be only for deleted app on button… but is there better way to identify if IAP is purchased?

btw: we fixed starting apps, dont fall down now. we correctly wait to listener. but if store.restore() doen’t work in some cases, users see ads… we are looking for some working solution. 

thanks again for your answer

You should get a “refunded” transaction event if the user requests a refund.  If they cancel while trying to purchase you will get a canceled event.

Rob

on Android we never got status “refunded” or “canceled” back in any event… It doesn’t work for us. What we should do? there is no way to check if product is refunded? we shouldn’t use store.restore(), but it works best from every things we tested.

What is best and correct practice?

is anywhere some example of these events for android? I tried searching, but didn’t find any solution.

If we use only local file, there are many refunds, how we read in forums. around 15% is unacceptable. people try refund and if it will works, they’ll tell to another people. We are still looking for some working solution for these cases.

thanks a lot for any help or answers…