CocoonJS Store not started

Bugs will be moved here once resolved.

Post » Wed Mar 20, 2013 6:06 pm

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:
[code]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[/code]
On Touch:
[code]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[/code]

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:

[code]
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);
     }
[/code]

Does that need to be somewhere in c2runtime.js as no html file is made for cocoonjs?
labithiotis2013-03-20 18:07:27
B
24
S
11
G
5
Posts: 140
Reputation: 5,004

Post » Thu Mar 21, 2013 3:03 pm

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

Post » Fri Apr 05, 2013 8:39 am

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
B
12
S
2
G
3
Posts: 57
Reputation: 3,439

Post » Wed May 29, 2013 6:11 pm

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'?

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

Post » Wed May 29, 2013 7:41 pm

@bon4ire - yes, the issue in question in this thread was resolved.
Scirra Founder
B
359
S
214
G
72
Posts: 22,952
Reputation: 178,600


Return to Closed bugs

Who is online

Users browsing this forum: No registered users and 5 guests