CocoonIO Restore Purchases

Discussion and feedback on Construct 2

Post » Wed Apr 20, 2016 12:51 am

Can anyone confirm that restore purchases works for CocoonIO?

I've managed to set up everything regarding IAP with Cordova IAP for Intel XDK, but struggeling to set up restore purchases with CocoonIO. Not sure if I'm missing something or this feature does not work?

I tried with Android.
ImageImageImage
B
31
S
19
G
82
Posts: 1,039
Reputation: 46,207

Post » Wed Apr 20, 2016 11:56 am

@AndreasR you're the Cocoon master ;). Can you confirm that it works? Or you haven't tested this part?
ImageImageImage
B
31
S
19
G
82
Posts: 1,039
Reputation: 46,207

Post » Wed Apr 20, 2016 12:26 pm

Alright - sorry for bothering. I've managed to make it work! ;)
ImageImageImage
B
31
S
19
G
82
Posts: 1,039
Reputation: 46,207

Post » Wed Apr 20, 2016 1:50 pm

BackendFreak wrote:@AndreasR you're the Cocoon master ;). Can you confirm that it works? Or you haven't tested this part?


Yes it does :)
I tested it in my Match3 game :)

Regards
Andy
Image Image iTunes: Match3 | Google Play: Match3
B
107
S
39
G
31
Posts: 1,173
Reputation: 29,260

Post » Wed Apr 20, 2016 9:23 pm

Well actually I need a hand @AndreasR. There are weird things going on with my Cocoon IAP implementation.

1. When I trigger "restore purchases", then it triggers "on product purchase completed" for every product which has been bought in the past.
2. Even though I recieve a restore purchases successful message. "Has product" still returns false.
3. CocoonInApps.ProductTitle breaks the script

In your example you provide a Product ID (which is a string) as a parameter of CocoonInApps.ProductTitle. However description of this function says it has to be a number.
Image
Image
Image

I think this is why my script breaks. And maybe even all the weirdies happen.

If you have IAP implemented in your working project. Could you please share your working implementation? Or point me to the tutorial/documentation? I can't find any official info regarding what the "Nth product" means. Is it Nth purchased product of all times or it's the sequence of products added to "Fetch products from store" or Nth of the current session or...?

I would be greatful if you could clarify this.
Thanks
ImageImageImage
B
31
S
19
G
82
Posts: 1,039
Reputation: 46,207

Post » Thu Apr 21, 2016 4:23 am

Hi,
Yes you are right. It triggeres the On purchase completes trigger instead of the 'has product'. Same is with the description/title. I did use the 'on completed' and 'has product' as 'or' block, so I haven't noticed that.
Thank you!

I'm building a testcase for Imanol, so this can be fixed.

I keep you posted :)

Regards
Andy
Image Image iTunes: Match3 | Google Play: Match3
B
107
S
39
G
31
Posts: 1,173
Reputation: 29,260

Post » Thu Apr 21, 2016 1:11 pm

AndreasR wrote:Hi,
Yes you are right. It triggeres the On purchase completes trigger instead of the 'has product'. Same is with the description/title. I did use the 'on completed' and 'has product' as 'or' block, so I haven't noticed that.
Thank you!

I'm building a testcase for Imanol, so this can be fixed.


Actually it triggers "On purchase complete" instead of nothing. When I run "Restore purchases" I expect plugin just to download information to the memory and do nothing else. Then once "Restore purchases" is done I expect "Has product" (in Cocoon it's called "Is product purchased") to be able check if product has been purchased before or not.

So to clarify:
### issue 1 ###
Function: Restore purchases
Current behaviour: It triggers "On purchase complete" for every product which has been purchased in the past.
Expected behaviour: Download information about purchased products. Triggers nothing by itself.

### issue 2 ###
Function: ProductTitle, ProductPrice (and other which requires Nth product parameter)
Current situation: Require Nth product integer parameter
Expected situation: Require Product ID string parameter (or documentation of how this should be properly used with Nth integer)

I'm not sure whi Imanol is but I guess is someone from CocoonIO team? Could you please share the Cocoon forum issue report link here if you created any? Or should I do it?
ImageImageImage
B
31
S
19
G
82
Posts: 1,039
Reputation: 46,207

Post » Fri Apr 22, 2016 7:45 am

I'm on it, but issue 2 is not an issue.
I'm writing a doc file at the moment, showing you how to access the plugin expressions. It's a little bit confusing, I have to admit that. But with the docs updated, it should be clear then.

About issue 1, yes you are right. I already have sent a message to Imanol.
I checked the plugin code of my own, but I couldn't find an answer why it calls the "On purchase completed" action. So I guess it's something located in the cloud plugin "InAPP for Google Play".

I keep you posted.
Image Image iTunes: Match3 | Google Play: Match3
B
107
S
39
G
31
Posts: 1,173
Reputation: 29,260

Post » Fri Apr 22, 2016 9:11 am

BackendFreak wrote:### issue 2 ###
Function: ProductTitle, ProductPrice (and other which requires Nth product parameter)
Current situation: Require Nth product integer parameter
Expected situation: Require Product ID string parameter (or documentation of how this should be properly used with Nth integer)

I'm not sure whi Imanol is but I guess is someone from CocoonIO team? Could you please share the Cocoon forum issue report link here if you created any? Or should I do it?


Hi,
the docs are now updated. so you can see how you can access the expressions.

https://shatter-box.com/knowledgebase/c ... ocument-12

I'll also publish the new code example for construct 2, but it's not done yet.

I'll keep you posted!

Edit: Now the C2 example file is ready as well
https://shatter-box.com/download/cocoon ... truct2.zip

Please see the docs in order to run it on an android device
https://shatter-box.com/download/cocoon ... readme.pdf

Regards
Andy
Image Image iTunes: Match3 | Google Play: Match3
B
107
S
39
G
31
Posts: 1,173
Reputation: 29,260

Post » Fri Apr 22, 2016 1:26 pm

Thank you @AndreasR! I will give it a try today. I think I would never guess that it's ordered alphabetically... I really thought it's something related to purchase order or market initialization ;). Thanks a lot.
ImageImageImage
B
31
S
19
G
82
Posts: 1,039
Reputation: 46,207

Next

Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 5 guests