Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Setting up In-app purchases on Google Play / Android - Please Help.

Author
Message
lmr2013
11
Years of Service
User Offline
Joined: 15th Jul 2013
Location:
Posted: 20th Sep 2015 10:24 Edited at: 20th Sep 2015 10:27
hi all,

im having some fun with in-app purchases on Google Play / Android.

was wondering if any master jedi's who have done this before out there can please help out. this was my code




first issue, when i buy an in-app, im getting a "Purchase Result: Signature verification failed for sku <myinappname> (response: -1003: Purchase signature verification failed)

i've been through the forum posts, and found i didnt set the InAppPurchaseSetKeys!!! what a fool!

so i went to the google play developer console, into my app, and under Services & APIs, under LICENSING & IN-APP BILLING, there is a Base64-encoded RSA public key, i assume this keys that is szData1 in the InAppPurchaseSetKeys ( szData1, szData2 ) setup.?

my code now looks like:



i thought surely THATS IT... all makes sense..

but just beta tested the new file, and the same -1003 error occurs (gutted!)

im thinking i've got the wrong szData1 number??

second issue,

I have 4 in-app purchases in the game, all of which are coins which can be bought over and over, as many times as the player wanted.

when setting up, Google play only offers me 'Managed Product' or 'Subscription', if definitely not a 'Subscription' so i chose 'Managed Product' and put in all the in-app info.

in the game, when you buy the coins (even though it fails at the moment with the -1003 error), once purchased, you cannot buy the coins again. If you try and buy again Google Play just says you already own this purchase. And then the process fails.

any guidance would be much appreciated. cheers all.
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 20th Sep 2015 13:44
Sorry, I don't have an answer for you. I'm just setting mailback because I'd also like to know this.

I do have an additional related question though:
I am just setting up my Google Payments Merchant Account and I need to supply a Legal Business name. What do I put there? I don't have a business. Do I need to set one up if I want to use In-App purchases?

AGK V2 user - Tier 1 (mostly)
lmr2013
11
Years of Service
User Offline
Joined: 15th Jul 2013
Location:
Posted: 20th Sep 2015 15:45
not sure scraggle, we registered as a business and entered that name.

update on the first issue:- i may have been going to fast for myself on the testing front, i uploaded a beta .apk (called version 2 with the InAppPurchaseSetKeys fix) to google developer console, which then produces an opt-in link for testers. I clicked on the link, logged into google, and installed the .apk from Google Play on my samsung galaxy tab. I thought the file i was installing would be latest beta file (that i'd uploaded moments before), but i've just seen that the beta files may take some time and will be delivered as an update. I've not had any updates, so im now thinking the beta file (version 2) i uploaded is still going through the google system. if correct, I may have been testing version 1 which dont work over again (thinking it was version 2) , and the beta (version 2) with the InAppPurchaseSetKeys fix still hasn't arrived on my device yet.

it's all new to me..

at the moment though, the IAPs dont work and still give the -1003 error.
lmr2013
11
Years of Service
User Offline
Joined: 15th Jul 2013
Location:
Posted: 20th Sep 2015 16:47
first issue - nope even with the updated beta (version 2) with the InAppPurchaseSetKeys fix still getting the -1003 error.

still getting the Purchase Result: Signature verification failed for sku <myinappname> (response: -1003: Purchase signature verification failed), even with the InAppPurchaseSetKeys set.

???
lmr2013
11
Years of Service
User Offline
Joined: 15th Jul 2013
Location:
Posted: 20th Sep 2015 22:13
thats it, time to give up.. been on this all day, changing settings and still no luck.

im still getting the response: -1003: Purchase signature verification failed, even with the InAppPurchaseSetKeys set - seems to occur no matter what i do.

I've checked the Base64 public key use in InAppPurchaseSetKeys 100's of times now - its EXACTLY the same as the one in Services & APIs, under LICENSING & IN-APP BILLING in the Google Developer console.

i cant release my game until i sort this.

Can anyone confirm if they have got AppGameKit in-app purchase commands to work on Google Play Store.? or am I just chasing my tail - if so, please someone put me out my misery. cheers.
lmr2013
11
Years of Service
User Offline
Joined: 15th Jul 2013
Location:
Posted: 21st Sep 2015 23:37 Edited at: 21st Sep 2015 23:44
[SOLVED]

Finally got the Google Play IAPS to work.!

the key is here:-

http://forum.thegamecreators.com/?m=forum_view&t=213118&b=46

my first issue...(the -1003 error)

You need to make sure you set InAppPurchaseSetKeys ( szData1, szData2 )

You can find szData1 on Google Play Developer Console in Services & APIs, under LICENSING & IN-APP BILLING, in there is a Base64-encoded RSA public key

szData2 = ""

so my first bit of code looks like this:-




Then you can activate the inapp purchase after a button press using




then you check if the inapp has been purchased using this...



But...!

the missing bit appears to be the getinapppurchaseavailable(0) code has to be in a LOOP of some form, so its checked multiple times - just running it once seems to fail, but if it's in a LOOP it seems to complete the IAP process. Thanks to Stormforce's example in the above link.





second issue...(that you cannot buy consumable items like coins over and over...)

this problem was being caused by the first issue, it appears when the -1003 error occurred the IAP process was not completed (so the IAP was not consumed - so it just gets stuck as purchased). Once the first issue was sorted, you can buy coins over and over using a 'Managed Product' in Google Play, as long as you set type set to 1 in InAppPurchaseAddProductID.

All seems to be working now.
Scraggle
Moderator
21
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 22nd Sep 2015 12:00
Thanks for the info

AGK V2 user - Tier 1 (mostly)
lmr2013
11
Years of Service
User Offline
Joined: 15th Jul 2013
Location:
Posted: 25th Sep 2015 22:14
Just to let you know, you only need to use a LOOP with Google Play IAP's, our game has just gone onto the Apple app store and the IAP's work when they are only called once. Just tested the IAP's on my ipad and they all work fine (without being inside a loop).

http://matchdayheroes.com/
http://2bigpixels.com/

Login to post a reply

Server time is: 2024-11-25 17:33:59
Your offset time is: 2024-11-25 17:33:59