[Plugins] Construct2 Cordova Plugins

Post your completed addons to share with the community

Post » Sun Aug 24, 2014 7:56 am

@cranberrygame

I am interested only in the IAP & AdMob plugins, is it possible for me to purchase only those (price?)? I have no need and no foreseeable need for all the others.

PM me and I can send the $ via paypal to you.
B
70
S
24
G
19
Posts: 1,757
Reputation: 17,616

Post » Sun Aug 24, 2014 9:13 am

@Silverforce
PMed
Thanks
Construct2 Cordova Plugins (currently 87 plugins): https://www.scirra.com/store/construct2 ... ugins-1662

Construct2 Prototype Capx (currently 50 capx): https://www.scirra.com/store/games-with ... -capx-3088

Home page: http://cranberrygame.com
B
65
S
22
G
81
Posts: 780
Reputation: 46,631

Post » Mon Aug 25, 2014 5:26 am

I just tested the IAP plugin and it works, really nice, faster response than CocoonJS (without relying on their servers to manage it!!).

I haven't tried if restore purchases work.

@cranberrygame How would you apply Restore Purchase with C2 & your plugin?

I'm thinking to do a check on Is Store available "Has product (Premium)" => Set Premium = 1 or something like that, is that fine?
B
70
S
24
G
19
Posts: 1,757
Reputation: 17,616

Post » Mon Aug 25, 2014 5:55 am

@Silverforce

Phonegap IAP plugin modeled from standard c2 IAP plugin.

So Phonegap IAP plugin support all standard c2 IAP plugin's functions exactly.

Problem is that How we can use standard c2 IAP plugin with the intention which Ashley's thought.

See example_phonegapiap_advanced_requires android application license key.capx

Premium variable is equals to PhonegapIAP.Has product "adremover"
so You can use the condition at the timing of wanting to know whether the product is purchased.

If You want to set Premium variable at first, I can add the event "On restore purchases success" as say.
"On restore purchases success" => "Has product (Premium)" => Set Premium = 1
Construct2 Cordova Plugins (currently 87 plugins): https://www.scirra.com/store/construct2 ... ugins-1662

Construct2 Prototype Capx (currently 50 capx): https://www.scirra.com/store/games-with ... -capx-3088

Home page: http://cranberrygame.com
B
65
S
22
G
81
Posts: 780
Reputation: 46,631

Post » Mon Aug 25, 2014 11:34 am

@cranberrygame

Hi, Just bought the plugins.I sent you a PM.

Tks
B
36
S
11
G
9
Posts: 400
Reputation: 10,285

Post » Mon Aug 25, 2014 4:12 pm

@cranberrygame

There's a big problem with the IAP functions.

Purchase a product (unmanaged consumable item in Google Dev Console) can only happen once. After a product is purchased, it will not be able to purchase again, returning the On Any Purchase Failed trigger.

I think you may need to change the code to consume the item, so that it is able to be purchased again.

You have set it up as if it were a permanent Managed IAP.

I have setup these 3 IAP in unmanaged mode (consumed, ie. repeatable IAP like potions or credits or gems etc). I just deactivated them to prevent users from buying since it would cause them to not consume it with the current plugin.
IAP.jpg


Let me know if you can fix the issue soon, I'll check back tomorrow (its 2:15AM here).
You do not have the required permissions to view the files attached to this post.
B
70
S
24
G
19
Posts: 1,757
Reputation: 17,616

Post » Mon Aug 25, 2014 10:32 pm

@cesisco

Sent, enjoy

@Silverforce

Added "Consume product" action

Try it. (plugin and example capx are updated, also)
Construct2 Cordova Plugins (currently 87 plugins): https://www.scirra.com/store/construct2 ... ugins-1662

Construct2 Prototype Capx (currently 50 capx): https://www.scirra.com/store/games-with ... -capx-3088

Home page: http://cranberrygame.com
B
65
S
22
G
81
Posts: 780
Reputation: 46,631

Post » Tue Aug 26, 2014 8:18 am

I can confirm it now works. But your CAPX should be sorted like so:

1. On Start of Layout => Add Product ID & Request Store Listing
2. On Store Available => Consume product1, wait 0.1, Consume product2, wait 0.1, Consume product3 etc.

I tested it your way (Has product => Consume) and it will only consume the first product out of many.

My way works for all consumable IAPs, I believe there needs to be a delay between them to allow communications with Google servers.

Also, to ensure they are consumed after purchase, add the Consume product into the events once Purchase Completed is called.

Thanks for the quick fix, it's working great. :D
B
70
S
24
G
19
Posts: 1,757
Reputation: 17,616

Post » Tue Aug 26, 2014 1:28 pm

@Silverforce

1.
How about:

Has product "product1" => Consume "product1" and wait 0.1
and another condition, Has product "product2" => Consume "product2" and wait 0.1
and the other condition, Has product "product3" => Consume "product3"

I think this is more accurate. (I didn't test this event, If possible test and let me)

2.

to ensure they are consumed after purchase, add the Consume product into the events once Purchase Completed is called ==> see updated example capx

Thanks for your test reporting.
Construct2 Cordova Plugins (currently 87 plugins): https://www.scirra.com/store/construct2 ... ugins-1662

Construct2 Prototype Capx (currently 50 capx): https://www.scirra.com/store/games-with ... -capx-3088

Home page: http://cranberrygame.com
B
65
S
22
G
81
Posts: 780
Reputation: 46,631

Post » Tue Aug 26, 2014 1:37 pm

It won't work because the condition like that in parallel gets triggered simultaneously. It will check all those Has product in that tic/frame and try to spam consume product (which communicates to Google).

If its not parallel, then the 2nd product condition depends on the first being true etc, so it wouldn't be a good way to do it.

Condition (On Store Available) => Consume product1, wait 0.1, Consume product2, wait 0.1, Consume product3 etc.

IAP.jpg


Ignore the conditions between the first and the last. This works for my game.
You do not have the required permissions to view the files attached to this post.
B
70
S
24
G
19
Posts: 1,757
Reputation: 17,616

PreviousNext

Return to Completed Addons

Who is online

Users browsing this forum: No registered users and 1 guest