eikuh avatar image
eikuh asked

NotifyFulfillment for Entitlement

Question 1:

What would happen if I did not call "notifyFulfillment" after a successful purchase of an Entitlement? I know that the docs says that I have to call it, but what would happen if I did not?

Question 2:

Is it OK to call notifyFulfillment each time the app starts? (again and again for all Entitlements?)

I am asking it because I am migrating from V1 to V2. And it is not sufficient to call notifyFulfillment after registering the successful purchase (because the app could crash right after registering the purchase and before notifyFulfillment). So actually, one would have to do that at the start of the app, too. But how do I know if I already called "notifyFulfillment"? At the moment, I call "GetPurchaseUpdates(true)" at app start (this is to be more consistens with the Google Play API). And this should get me all Entitlements (fulfilled and not-fulfilled), right?

So, do I need a "GetPurchaseUpdates(false)" before "GetPurchaseUpdates(true)" to know if I still have to call "notifyFulfillment"?

May I know why you chose such a uncommon way?

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Levon@Amazon avatar image
Levon@Amazon answered

Hi eikuh,

Thanks for posting! A call to notifyFulfillment() is recommended. It is not strictly required, because the purchase will go through even if you don't call it, however there are some restrictions: when testing your IAP implementation with the App Tester (locally on the device before submitting the app to Appstore), it is required to call notifyFulfillment(), otherwise it won't work with App Tester. Also, if the user wants to buy more than 1 item within the same session, again it's required to call notifyFulfillment() for the first purchased item, so your app doesn't run into a situation where the second purchase is impossible to process, and so on. So, I would strongly suggest calling notifyFulfillment() after every purchase.

I haven't seen anyone calling notifyFulfillment() when their app starts, and that's not something that we recommend. You don't really need to do that. In this specific case, assume that even if your app crashed previously before notifyFulfillment() was called explicitly, assume that it was called implicitly. I agree that it's somewhat different from Google Play IAB API, and if you have any other / specific questions, please let us know. Thanks!

10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.