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.
Global Bought
InAppPurchaseSetTitle ("Buy Me") // Name for alert dialogs etc.
InAppPurchaseAddProductID ("com.zortokgames.inapptest.buyme", 0) // IAP product ID you configured through iTunes / Google
InAppPurchaseSetup()
Rem see if bought already !!
If GetInAppPurchaseAvailable(0) Then Bought = 1
button = createsprite(loadimage("button.png"))
setspriteposition(button,100,100)
setspritescale(button,0.4,0.4)
rem A Wizard Did It!
do
Print ("In-app purchased : " + Str(Bought))
if GetPointerReleased() = 1 And GetSpriteHitTest(button, GetPointerX(), GetPointerY()) = 1
InAppPurchaseActivate(0) // 0 = id of product
// Wait for user to purchase or cancel prompt
While GetInAppPurchaseState() = 0
Sync()
EndWhile
// User has canceled or already purchased
If GetInAppPurchaseAvailable(0) < 1
// ...
Endif
// User has upgraded!
If GetInAppPurchaseAvailable(0)
Bought = 1
Endif
endif
Sync()
loop
Any pointers as to what I've done wrong here?
Many thanks, Ian.