CocoonJS IAP Checklist

0 favourites
  • <font size="3">EDIT:

    <font color="orange">IT'S ALIVE!</font>... Below is the list of things you'll need to do to get IAP working on iOS CocoonJS (I only assume this works for Android too). Will wrap this all up into a nicer tutorial when I have some spare time. But for the moment for anyone else tring to get IAP use this checklist as a starting point</font>

    1. Construct 2 r123.2 or later (this has the crucial update to enable the CocoonJS's IAP Store) <img src="smileys/smiley20.gif" border="0" align="middle">
    2. Apple Developer Account <img src="smileys/smiley20.gif" border="0" align="middle">
    3. App ID set-up with Bundle ID: com.appname <img src="smileys/smiley20.gif" border="0" align="middle">
    4. App ID IAP Configured and Enabled <img src="smileys/smiley20.gif" border="0" align="middle">
    5. App Provision set-up with App ID & Device UDID <img src="smileys/smiley20.gif" border="0" align="middle">
    6. IAP set-up with App ID with Product ID: com.appname.premium (for c2) <img src="smileys/smiley20.gif" border="0" align="middle">
    7. IAP added to App <img src="smileys/smiley20.gif" border="0" align="middle">
    8. Test Account created for IAP testing (needs to be a unique ID and valid email) <img src="smileys/smiley20.gif" border="0" align="middle">
    9. My current App status is "Prepare for Upload" <img src="smileys/smiley20.gif" border="0" align="middle">
    10. Xcode set-up with devices as developer <img src="smileys/smiley20.gif" border="0" align="middle">
    11. Device is signed out of App Store <img src="smileys/smiley20.gif" border="0" align="middle">
    12. Premium CocoonJS Account - Either fill form or send email asking for it. It's free atm and does take a couple of days <img src="smileys/smiley20.gif" border="0" align="middle">
    13. Once you have Premium Account, enable Store in Extension on cloud compiler <img src="smileys/smiley20.gif" border="0" align="middle">
    14. In In-App Purchases (once you've enable store above) in configuration put you IOS Share Secret Key and Tick Sandbox mode for TESTING.<img src="smileys/smiley20.gif" border="0" align="middle">
    15. Add your Product to the Available Products (same ID as the ones set-up on Apple/Google i.e. com.appname.premium), these are for testing. <img src="smileys/smiley20.gif" border="0" align="middle">
    16. CocoonJS cloud compiler set-up to build xCode projects (All iOs assets and Bundle ID same as App ID) <img src="smileys/smiley20.gif" border="0" align="middle">
    17. xcode and Mac set-up with provision profiles and certificates allowing CocoonJS build to compile and run to device (sandbox mode) <img src="smileys/smiley20.gif" border="0" align="middle">
    18. Have the following Construct 2 events:     var Global text IAP1 = "YOUR IAP ID i.e. com.appname.premium"     On Start of layout       CocoonJSAds Is In CocoonJS         ConcoonJSAds Is Store available           ConcoonJSAds Is product IAP1 purchased | Set Premium to 1     Touch | On touched "MY BUTTON" | Call "Premium" //Can attach this action to as many call to action objects     Function on "Premium"       CocoonJSAds Is In CocoonJS         ConcoonJSAds Is Store available           ConcoonJSAds Is product IAP1 purchased | Set Premium to 1 & ConcoonJSAds Restore Purchases           else | CocoonJSAds | Purchase product IAP1 with preview     CocoonJSAds On IAP1 purchase complete | Set Premium to 1     CocoonJSAds On IAP1 purchase failed   | ChromeConsole | "Failed" //Could put a popup to tell user the IAP failed

    Still trying to work out Restoring Purchases as this doesn't seem to work (call it on load to update assets).

    I'm also having troubles removing/resetting the IAP. Tried to remove the purchase from the Purchased Transaction on CocoonJS cloud settings but the system still think's the IAP is purchased (also tried rebuilding after removing transaction). Might have to make another test account.

  • I've been currently attacking the same thing but on the android side. My next steps are to attempt communication to the google play store from within the app.

  • Unfortunately, I too was unable to get it to work on android side. Been using the 'android.test.purchased' ID for fake transactions, but it doesn't initiate any type of window. There also doesn't seem to be a way to output any IAP feedback results if a state has been initiated as it shows in the IAP Cocoon app demo.

  • Are you using a loader layout? If not 'On loaded' won't fire. Just use 'On start of layout'. Also in the events you posted I don't see anywhere that the "Premium" function is called.

    If it still doesn't work, I'd ask Ludei what's wrong.

  • Oh sorry, the first section is under a "On Start of Layout" (was tiered while writing the first post).

    As for the function call I have that attached to several On object touch events, I know for certain that the Premium Function is being called.

    I'll try sifting through ludei's forums and failing that I'll contact them directly then.

  • Then post here the response from ludei after all games for mobile with concoonjs always is always a subject of interest.

  • Well, this is their first response :

    "As far as we know, Construct doesn't have any integration with CocoonJS's IAP system.

    Right now we think you'd have to program that integration as a JS extension to Construct."

  • I'm wondering if Ludei has their own copy of C2. Mainly to help focus on assisting development of their plugin.

  • Argh. They're wrong, we wrap their IAP system with the CocoonJS object. I've already asked them to improve their documentation for Construct 2 users, but at some point I'll try and figure out what's going on with their system.

  • Ashley, sorry for the misunderstanding. We are glad to see that CocoonJS features like IAPs are present. Thank you very much for the awesome support of the platform! We will try to improve the documentation to help you as much as we can.

  • While we're waiting for this documentation, is it something I haven't configured on the cocoonJS side after getting the compiled project from you? I.e. Xcode build settings.

  • Updated the first post as I got this working, have listed all the things I did to get it working.

  • Yes! I'm glad to hear it's working!

    UPDATE

    I just tried it on android Google Play and it works <img src="smileys/smiley4.gif" border="0" align="middle">

    The last pieces of making this IAP complete would be to gather purchase information as listed in the cocoonjs wiki.

    http://doc.ludei.com/CocoonJS_Store/symbols/CocoonJS.Store.PurchaseInfo.html

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • bon4ire I m use c2 version r-119 . But I Have no idea how to use cocoonjs in-app billing in c2 according ot labithiotis I have follow the step but the button is not working (when I touched the button it should go to google play store but right now itz not working so can you share your .capx file how to do this please help me )

  • You'll need at least version 123.2.

    It's partially working to the point where an order can be made, but that's about it.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)