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.

Android / Help - in-app purchasing

Author
Message
ApkGames.Guru
10
Years of Service
User Offline
Joined: 25th Oct 2013
Location: England, UK
Posted: 13th Jun 2014 18:46
Hi, can someone help?

Having read various forums on example code for in-app purchasing, I thought I'd try it by putting together a quick app with the code and loading to Google Play, downloading to my mobile (as a different user) and testing it......

This is the code I've used. When I load the APK to Google, it doesn't give me any details about in-app purchasing and says I must set BILLING rights etc. When I download and test, it does nothing. I'm using basic via AGK.



Any pointers as to what I've done wrong here?

Many thanks, Ian.
Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 15th Jun 2014 23:23
What intepreter are you using? Lite / Prebuilt / Standard?
I think all of them include the necessary permissions. Make sure your AndroidManifest has billing permission and IAP Activity defined.
Did you get your base64key from your developer dashboard and copy it to the AGKHelper.java file?
Your code looks fine it is likely a java setup issue.
If you're not familiar with using Eclipse and setting up IAP check out my guide naplandgames.com/agk
It will walk you through it.
Also make sure you have the product set up in your Google Play developer dashboard for the app. This is also where you find your base64 key.

Other than that we'll need more information on the exact errors you receive to help you further.

ApkGames.Guru
10
Years of Service
User Offline
Joined: 25th Oct 2013
Location: England, UK
Posted: 16th Jun 2014 13:40
Thanks for this.

I'm using Tier 1 (basic) within the IDE 108.21

I've taken the Google play 64 bit key and coped as directed to the agkhelper.java file.

You mention "Make sure your AndroidManifest has billing permission and IAP Activity defined.". Is this something I can do via the IDE I have or is there a file I would need to amend?

Thanks again, Ian.
Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 16th Jun 2014 19:52
You edit the AndroidManifest.xml in Eclipse, but this shouldn't be necessary as all of the interpreter projects are already set up with it like this.
Did you set up the product in the google play developer console?
IAP won't work until the APK file is uploaded to Google Play (I upload mine to alpha for testing IAP).

I need more information on this:

Before I can help you further.

ApkGames.Guru
10
Years of Service
User Offline
Joined: 25th Oct 2013
Location: England, UK
Posted: 16th Jun 2014 20:17
Hi, I don't use eclipse, I user Tier 1 and then the following link, that creates the APK for me.

https://developer.thegamecreators.com/android/create_apk.php

Using this method, is there a way to set the XML still, so it compiles into my APK? When I try my app, I get an error along the lines of the item you are trying to purchase could not be found.

I guess this is because upon upload to Google Play, the APK does not detail that billing is part of my code.... and therefore does not recognise it as an in-app purchase game.

Regards, Ian.
Naphier
13
Years of Service
User Offline
Joined: 2nd Oct 2010
Location: St Petersburg, Florida
Posted: 16th Jun 2014 20:20
That won't work.
Quote: "The generated APK will not currently work with In App Purchasing or Push Notifications for Android (otherwise known as Google Cloud Messaging)."

Is right on the page.

You need to go through the full Eclipse setup or use Automate
http://forum.thegamecreators.com/?m=forum_view&t=210058&b=41

ApkGames.Guru
10
Years of Service
User Offline
Joined: 25th Oct 2013
Location: England, UK
Posted: 16th Jun 2014 22:28
Ok, many thanks. Silly of me not to have noticed. I will try the automate one-click method

Login to post a reply

Server time is: 2024-04-25 17:36:49
Your offset time is: 2024-04-25 17:36:49