CocoonJS Store not started

0 favourites
  • 5 posts
From the Asset Store
2D fighting template based in the game that defined the fighting games genre.
  • Pre-requisites

    IAP Checklist

    Also I have now got a CocoonJS premium account which gave me compile options for Cocoonjs store and added the IAP to cocoonjs store.

    Link to .capx file (required!):

    https://dl.dropbox.com/u/2175584/Construct2Examples/IAPTest.capx

    Steps to reproduce:

    1. Launch compiled project from ludei (cocoonJS) in xcode

    2. Observer console log

    3. Comment out the on start (crashes app)

    4. Load again

    5. Press the buy button

    6. Observer console log

    Observed result:

    Console log :

    At Start:

    JavaScript Exception ( Tag: 'timer'): Exception calling 'IDTK_SRV_STORE' extension with
    'isFeaturePurchased' funtionName: IllegalStateException: Trying to use a non started service
    at virtual bool com::ideateca::service::store::AbstractStoreService::isFeaturePurchased(const
    string &) const:519

    On Touch:

    JavaScript Exception ( Tag: 'touchstart'): Exception calling 'IDTK_SRV_STORE' extension
    with 'isFeaturePurchased' funtionName: IllegalStateException: Trying to use a non started
    service at virtual bool
    com::ideateca::service::store::AbstractStoreService::isFeaturePurchased(const string &) const:519

    Expected result:

    Am I getting this error because CocoonJS.Store.start(); isn't being called in c2runtime.js. I have tried manually executing this function from C2 using callJs.

    Browsers affected:

    Chrome: no

    Firefox: no

    Internet Explorer: no

    CocoonJS: yes

    Operating system & service pack:

    Windows 8

    Construct 2 version:

    r122

    Notes:

    Looking at Ludei's example IAP they have this code in their HTML:

     
    isStoreAvailable = false;
    products = new Array();
    purchases = new Array();
    
         if (CocoonJS.Store.nativeExtensionObjectAvailable && CocoonJS.Store.canPurchase())
         {
              isStoreAvailable = true;
    
              CocoonJS.Store.onProductsFetchStarted.addEventListener(onProductsFetchStarted);
              CocoonJS.Store.onProductsFetchFailed.addEventListener(onProductsFetchFailed);
              CocoonJS.Store.onProductsFetchCompleted.addEventListener(onProductsFetchCompleted);
    
              CocoonJS.Store.onRestorePurchasesStarted.addEventListener(onRestorePurchasesStarted);
              CocoonJS.Store.onRestorePurchasesCompleted.addEventListener(onRestorePurchasesCompleted);
              CocoonJS.Store.onRestorePurchasesFailed.addEventListener(onRestorePurchasesFailed);
    
              CocoonJS.Store.onProductPurchaseStarted.addEventListener(onProductPurchaseStarted);
              CocoonJS.Store.onProductPurchaseFailed.addEventListener(onProductPurchaseFailed);
              CocoonJS.Store.onProductPurchaseCompleted.addEventListener(onProductPurchaseCompleted);
    
              CocoonJS.Store.start();
    
              refreshProducts();
              refreshPurchases();
    
              CocoonJS.Ad.preloadBanner();
              CocoonJS.Ad.setBannerLayout(CocoonJS.Ad.BannerLayout.BOTTOM_CENTER);
         }
    

    Does that need to be somewhere in c2runtime.js as no html file is made for cocoonjs?

  • R123.2 as done it <img src="smileys/smiley20.gif" border="0" align="middle" /> I now have popups with correct IAP information from apples store sandbox but with the tester account I am not getting on purchase complete triggers. Will investigate further before bugging you with it.

    Great job and thanks for adding this in so quickly, this is one GAINT step forward for making IAP work in C2 & CocoonJS.

    I can see the finish line! Woo

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • IAPTest.capx File is not working I have checked it there is a buy image When I touched that it doesn't do any thing permium is 0 and after the touched it show permium 0

    I have tested it on c2 version r-124

  • Has this been resolved? I get the initial purchase and purchase complete through google play but cannot verify a purchased product. Could it be issues with the 'Is product purchased'?

  • bon4ire - yes, the issue in question in this thread was resolved.

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