iOS in-app purchases

Hello, I’m trying to setup IAP with (what I understand to be) the official IAP extension:

Everything works fine on android, but when testing on ios I can’t seem to get the IAP.init() method to fire successfully.

Are there are any ios-specific caveats I need to be aware of? For example on android you need to add a special IAP permission to your manifest file. I didn’t find this mentioned in the (terse) documentation for iap, so I’m not sure if I missed something analogous for ios.

Also, While I have an IAP registered with itunes connect, my IAP “contract” is still being processed, so would that cause a complete failure of the init function?

I would start with “IAP.available” and if true, “IAP.init”, it’s possible that without the correct server-side things configured for you, IAP.available would return false, or initialization would fail. IAP is a tricky thing because so much relies upon the proper server environment

Hm, if I’m reading correctly, it looks like “IAP.available” will always return true for the ios target?

Also, will the ‘message’ property of the IAPEvent class actually be filled with a relevant error message when a connection/purchase/etc fails? If so I can attempt to inspect that for more clues.

1 Like

Just a heads up, I was able to complete a purchase by skipping the check for the init() success event on ios.
Is the init method perhaps never sending back an ‘init success’ event at all?

I use a local variable to track whether or not I am allowed to make a purchase, the state of this variable is set by either PURCHASE_INIT or PURCHASE_INIT_FAILED

I can’t rely directly on IAP.initialized as it is private. It looks like I can probably just skip this confirmation process entirely, but it sounds like a wire hasn’t been connected properly somewhere?