[SOLVED] How implement In-App Purchase?

Previous topic - Next topic

msx

Hi MrPlow,

What surprises me is that the result of InAppPurchase_isOnline () is always 0. Is not it logical to give a different value ?.

BTW, once uploaded to the store an alpha version. can I do tests directly using ADB or have to upload a version each time?

spacefractal

That function might not work, did have various issues. but you should not bother that at all. You should possible to checks price etc when it's online.

You might need to sign the app before it's working, (from a test account), but you don't need to upload it, after upload it's first time so google play got it registered with the BILLING. But no need to online. Beta is ok.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

MrPlow

#17
What is the best way for implementing with more than 1 item to buy...?

GLOBAL INAPP_NR_OF_ITEMS=2 

So how to InAppConfig_SkuNames$ for the correct item?

InAppHelper_SetSku seems to do something on InAppHelper_Init() function...but unsure what that is?

[edit]

If think I might have figured out the ID$="0" is the first product id by default and "1" is the next

IF iID$="0" OR iID$="product1"
...
Endif
IF iID$="1" OR iID$="product2"
...
Endif

Doing like so would work for multiple skus?


SORTED! Got it working !! Great stuff!
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

MrPlow

I spoke too soon...

I got the system to display two numbers

but 1 of the numbers was different on another device.

the number that was the same was links to the other product...

Is there a correct way to implement for multiple skus on Android?

Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

msx

MrPlow, could you send me the files that you use to inapp?

when you call to InAppPurchase_Price$(), responds product price?

I'm desperate :(

MrPlow

Gonna compile to see if Price$() works now...

Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

MrPlow

#21
Yes, my Price works to show euro 1.79
I have to go out now but I will send files later ... I copied code from them in here already though...
Your Android Extras version might not work with my older files?

Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

msx

if the solution is to downgrade the version of Android extras I have no problems in doing so.

MrPlow

Hi msx

This is version I am using but you need a full AE install for those...so that SDL library is correct etc.

You can probably side-install to another copy of GLB with the older AE.

Rgds
Gary
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

msx

I've finally gotten to purchased but the problem is that the rest of the functions do not work so I have no way to verify that the purchase has been made.

InAppPurchase_Price$ not work, it always responds -1 or unknown

InAppPurchase_isAvailable not work, always answers a hash number that does not change after purchasing successfully.

So now I get to make purchases but I have no way to check whether the purchase has already been made above.

spacefractal

Dont do that in startup, but checks in a loop each one second or two. This due the init is asycron and might firsts been finished in the menu after your game loading.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

spacefractal

There is if I'm remember a variable that can been checked the init status, but remember which one it's was and is still not home yet.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

msx

#27
...

spacefractal

im home again. did you get it to work, or do you need more work?
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

MrPlow

Quote from: spacefractal on 2016-Aug-08
im home again. did you get it to work, or do you need more work?

Hi I got my multiple product version working I think.
The hashnumber returned is based on the store and the product id name isn't it?

So that if you had a different general reference for a product that would change the hash value?

It was that which caused me some confusion with code but seems fine now :)
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs