Problem with PhonegapIAP plugin

Discussion and feedback on Construct 2

Post » Tue Dec 30, 2014 9:48 pm

Hi,

I have problem with the PhonegapIAP plugin from @cranberrygame .
After exporting via Intel XDK and testing my game on Google Play, payments works well, but the "on product ----- purchase success" condition doesn't trigger. The result is that my testers are charged, but they don't get what they paid for.

Am I doing something wrong or do I have to find a workaround? (maybe trigger once the "has product" condition?)
The "on product purchase success" condition is checked every tick, so I guess that's not the problem
B
32
S
6
G
1
Posts: 353
Reputation: 2,821

Post » Tue Dec 30, 2014 10:27 pm

This isn't the same technology, but may have a similar solution:

https://www.scirra.com/forum/in-app-purchase-issue-ios-cocoonjs_t112489?start=60

Quoted from that link:

simply you need to put this events:
"on product fetch complete > update product list"
you must update products list to be able to take the varius products's proprerties (such as price, name, description ecc...)

Basically maybe you need to refresh something before the status shows up?
B
21
S
5
Posts: 196
Reputation: 1,984

Post » Tue Dec 30, 2014 10:41 pm

Thanks for the suggestion !
I added an event "On any purchase success --> request store listing" at the beginning of the event sheet, and will test the result tomorrow.
B
32
S
6
G
1
Posts: 353
Reputation: 2,821

Post » Tue Dec 30, 2014 11:43 pm

On Start of Layout
=> Add product IDs
=> Request store listing

It also works fine if you trigger those on menu touch (open shop menu for example).

On Touch MenuIcon
=> Add product IDs
=> Wait 0.1s
=> Request store listing
=> Open Menu
B
70
S
24
G
19
Posts: 1,757
Reputation: 17,616

Post » Wed Dec 31, 2014 11:17 am

Seems like I just forgot to add product IDs. Thanks a lot !

Do you know if this PhonegapIAP plugin works the same way on iOS and WP8 builds using intel XDK?
B
32
S
6
G
1
Posts: 353
Reputation: 2,821

Post » Thu Jan 01, 2015 12:41 am

Rable wrote:Seems like I just forgot to add product IDs. Thanks a lot !

Do you know if this PhonegapIAP plugin works the same way on iOS and WP8 builds using intel XDK?


You'll have better luck asking Cranberrygame directly, there's a long thread for his plugins in the Completed Addon forum.
B
70
S
24
G
19
Posts: 1,757
Reputation: 17,616

Post » Thu Jan 01, 2015 2:45 am

After uploading the game to Google play and testing, the purchases are still not taken into account. And after rechecking, I actually already added the product IDs at the start of the level the first time. So the problem is still there...

Here is how my code goes :

- at the start of the level --> add product IDs
(after the combat, 2 minutes or so later)
- when entering the map --> add product IDs (again ! this time in separate actions, first time it is all in one action, comma separated) (This is the event I added following your message, so it doesn't work if I simply delete it)
- wait 0.1 second
- request store listing

(then, on confirming purchase by touching the "confirm" object)
(these 2 are checked every thick)
- on touched object --> purchase product "product1"
- on product "product1" purchase success --> change the value of a global variable (which is not done)


In addition, on my title screen I have the following :

- Add products IDs
-wait 0.1 seconds
- request store listing

-On store listing success -->
- Has product "product1" --> change the value of the global variable... which is not done either !

I can confirm the payment options are working, I get paid,but people doesn't receive the content... :-/
Any idea of what's going on? Maybe @cranberrygame can help?

This is very ennoying, as the game should release next month and my beta testers are currently blocked at the end of the free version. :(
B
32
S
6
G
1
Posts: 353
Reputation: 2,821

Post » Fri Jan 02, 2015 1:55 pm

After doing some additional research and testing the purchases in a simple .capx file, it seems that when I set the action "Request store listing", it always fails. The result is that the users can purchase the products but the condition "on purchase success" don't trigger.

When the store listing fails, I set the action :
set text to : "Store listing failed !" & PhonegapIAP.ErrorMessage
The return is just "Store listing failed !" (no error message displayed)

Here is the capx of my test file, if it could help...
https://www.dropbox.com/s/34iciejfb0jyr ... .capx?dl=0

Any idea what I could do to make the store listing successful?
B
32
S
6
G
1
Posts: 353
Reputation: 2,821

Post » Fri Jan 02, 2015 2:19 pm

@Rable

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 » Sat Jan 03, 2015 5:16 am

Thanks cranberrygame for the help provided ! I learned that for purchase-based conditions one should use "is touching object"+"trigger once" instead of "on touched object". But my "store listing failed" problem still apply... :(

I posted a topic in the publishing and distribution forum as I believe the problem is probably not directly related to C2.

store-listing-failed_t121933
B
32
S
6
G
1
Posts: 353
Reputation: 2,821


Return to Construct 2 General

Who is online

Users browsing this forum: No registered users and 7 guests