How do I use Google Play and IAP objects properly?

Get help using Construct 2

Post » Tue Apr 28, 2015 3:46 am

Has anyone used the Google Play object properly?
https://www.scirra.com/manual/175/google-play

Can you please share what you have got?
Last edited by jogosgratispro on Thu Apr 30, 2015 6:53 pm, edited 1 time in total.
B
124
S
51
G
24
Posts: 401
Reputation: 22,617

Post » Tue Apr 28, 2015 2:14 pm

I keep asking for Google Play and IAP objects for a week already and got no response at all. So will keep track on this post as well.
ImageImageImage
B
28
S
16
G
82
Posts: 1,030
Reputation: 45,804

Post » Tue Apr 28, 2015 8:34 pm

Hi @ashley,

I know you are super busy adding features to Construct2 but I would really appreciate if you could create a .capx using the information you provided on the manuals for Google Play and IAP.
I have seen it everywhere but it is very confusing the way to setup the whole thing.
I would like to implement leaderboard, achievements and IAP without using extra plugins.

thanks,
B
124
S
51
G
24
Posts: 401
Reputation: 22,617

Post » Thu Apr 30, 2015 6:39 pm

Hi @jogosgratispro,

I've managed to make IAP work. There were few things which made a confusion so I will list them below, hopefully it wil help others as well.
1. You should obviously read the tutorial for C2 IAP first.

2. "Has Product" condition is not a check for availability of the product in store. With this condition you can check if customer has already purchased a managable product ( like "premium_account" or "remove_ads" not like "gold" or "coins"). It is explained in tutorial however I saw some ppl were using it in a wrong way (as did I) so I think it's worth to highlight this.

So the correct way would be:
On Touch("buy_button") -> Purchase product("gold1000")

Incorrect is:
On Touch("buy_button") -> if Has Product ("gold1000") -> Purchase product("gold1000")

3. There are some examples using cranberrygame Phonegap IAP plugin, and this plugin requires a licence from Android Developer Console which seems to be very logic as this seems to be a kind of API Key for authentication. I spent a lot of time searching for a way to authenticate official IAP plugin in the same manner. I even thought that maybe it works with Google Play plugin (in this plugin you have to pass licence and app Id). But the answer was much easier - there is no need to provide any API key for C2 official IAP plugin. You simply add it to the project and use it without any configuration.

I am sure those are obvious and trivial things for some of you, but those are the problems I had and I found some simmilar (unanswered) questions on this and other sites so it look like common problems/missunderstandings.

It's also worth to mention that IAP can't be tested on any emulator so after every change you have to wait hours or days before market accept it as alpha/beta version so you can test your changes. I spent over a week to figure out those 2 "simple" problems. Hope it will help some of you.

@jogosgratispro I think you can change the topic title to "How do I use Google Play and IAP objects properly?" cause those two are also confused to be connected as well.
Last edited by BackendFreak on Fri May 01, 2015 10:39 am, edited 1 time in total.
ImageImageImage
B
28
S
16
G
82
Posts: 1,030
Reputation: 45,804

Post » Thu Apr 30, 2015 6:52 pm

@BackendFreak

Thank you very much for your help.
Now I am more confident about leaderboard and achievements using cranberry plugin. I'm in the final stage of making it to work properly.

I will try to implement the IAP tips you mentioned in your answer.

thanks,
B
124
S
51
G
24
Posts: 401
Reputation: 22,617

Post » Sun Jun 28, 2015 12:49 am

i have a weird error "Autorization Required" always promp when using IAp, ¿did someone had the same problem?
B
22
S
4
Posts: 106
Reputation: 1,360

Post » Thu Jul 16, 2015 2:00 pm

Hi @kingpirux. I did not have that error, but just wanted to mention that after all I am using PhonegapIAP. C2 IAP does not have consume action which means that you cannot sell "unmanaged" products (products which can be bought multiple time).
ImageImageImage
B
28
S
16
G
82
Posts: 1,030
Reputation: 45,804

Post » Thu Jul 16, 2015 6:41 pm

o i fixed the problem, actually there are some rules in the name of the product, all smallcaps, no spanish letters, avoid spaces and simbols, etc... with that it goes ok!
:) an other thing, when somebody purchase something, it could take up to 48 hs to become active and some times the "Purchased" is not triggered, so is good to warn that and create a "restore purchases" every time the game starts.
B
22
S
4
Posts: 106
Reputation: 1,360


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 47 guests