iOS + Construct 2 + IAP, how do I make it work?


Hey there,

There seems to be many different ways to make this happen, but so far trying to decipher the different docs and articles has lead me to the “CocoonInApps” plugin but when I add it to the project and try and use it, it gives a Javascript error: “TypeError: undefined is not an object”.

Are there any up to date methods on making a simple In App Purchase work on iOS with Construct 2?

Can it be tested using the Cocoon Developer App?

Thanks heaps for the help, Dan.



have you installed it in your cocoon project as well?




I’ve installed “In-App Purchases for iOS App Store” is that the right one?

Thanks, Dan.


If you build for iOS then yes, if you build for Android, also add the “In-App Purchases for Google Play” plugin.
DId you install it in construct 2?


Yeah it’s solely for iOS at the moment.
I have the “CocoonInApps” plugin/object in the project yes.


Here’s a screencap of events, I haven’t worked with Cocoon since it was Cocoonjs so appreciate the help in learning the new ways.

Screen Shot 2017-06-13 at 4.50.53 pm


Basically this should work. What’s the actual issue you get when you try to purchase an item?
If you want to learn how inapps work, you can use my template here.



It gives me a black screen if I have the plugin in use at all, that’s the issue :confused:

That template looks real cool, if I were to make something more complex I’d probably grab it as a starter template.

Thanks, Dan.


If you add the Inapp plugin to construct 2, you must do the same in your Cocoon project. Otherwise you will get a blackscreen.So go to the plugin tab, “Cocoon” and installl “InApp purchases for [your platform]”.
You find a guide over here:


Turned out I was exporting the project wrong. I was using the built in Cocoon export on Construct which works perfectly until you add the In App Purchase plugin. So now I’m exporting with Cordova and it’s working on 2.0.0



Great to hear :slight_smile: I’ll close this topic then.

Thank you!



This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.