CocoonJS IAP Checklist

Discussion and feedback on Construct 2

Post » Fri Mar 08, 2013 9:19 pm

EDIT:
IT'S ALIVE!... 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


  1. Construct 2 r123.2 or later (this has the crucial update to enable the CocoonJS's IAP Store)

  2. Apple Developer Account

  3. App ID set-up with Bundle ID: com.appname

  4. App ID IAP Configured and Enabled

  5. App Provision set-up with App ID & Device UDID

  6. IAP set-up with App ID with Product ID: com.appname.premium (for c2)

  7. IAP added to App

  8. Test Account created for IAP testing (needs to be a unique ID and valid email)

  9. My current App status is "Prepare for Upload"

  10. Xcode set-up with devices as developer

  11. Device is signed out of App Store

  12. Premium CocoonJS Account - Either fill form or send email asking for it. It's free atm and does take a couple of days

  13. Once you have Premium Account, enable Store in Extension on cloud compiler

  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.

  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.

  16. CocoonJS cloud compiler set-up to build xCode projects (All iOs assets and Bundle ID same as App ID)

  17. xcode and Mac set-up with provision profiles and certificates allowing CocoonJS build to compile and run to device (sandbox mode)

  18. Have the following Construct 2 events:
    [code]
        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

    [/code]


    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.labithiotis2013-03-21 22:06:57
B
24
S
11
G
5
Posts: 140
Reputation: 5,004

Post » Fri Mar 08, 2013 10:09 pm

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.

B
31
S
6
G
4
Posts: 160
Reputation: 5,998

Post » Sun Mar 10, 2013 3:59 am

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.

B
31
S
6
G
4
Posts: 160
Reputation: 5,998

Post » Sun Mar 10, 2013 3:02 pm

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.Ashley2013-03-10 15:02:18
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Sun Mar 10, 2013 3:42 pm

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.
B
24
S
11
G
5
Posts: 140
Reputation: 5,004

Post » Mon Mar 11, 2013 3:30 pm

Then post here the response from @ludei after all games for mobile with concoonjs always is always a subject of interest.
B
37
S
8
G
4
Posts: 85
Reputation: 5,099

Post » Mon Mar 11, 2013 4:33 pm

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."

B
24
S
11
G
5
Posts: 140
Reputation: 5,004

Post » Mon Mar 11, 2013 5:01 pm

I'm wondering if Ludei has their own copy of C2. Mainly to help focus on assisting development of their plugin.
B
31
S
6
G
4
Posts: 160
Reputation: 5,998

Post » Mon Mar 11, 2013 5:28 pm

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.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600

Post » Tue Mar 12, 2013 12:28 am

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.
B
9
S
4
G
4
Posts: 383
Reputation: 3,616

Next

Return to Construct 2 General

Who is online

Users browsing this forum: neverk and 13 guests