In-app purchasing

Ralph DiMola rdimola at evergreeninfo.net
Tue Jan 19 19:09:00 EST 2021


Yes it works. I've done it on both platforms. The tutorial in the LC lesions
pretty much says it all. 

1) Name your in-app purchase products exactly the same on both platforms.
Make them all lowercase. One of them does not allow uppercase(forgot which)
and of course I used the upper on the one that allowed it first. The LC
calls to purchase commands are case sensitive.

2) It's an async environment. So you have to set up a wait loop while
watching the progress of the mobileStoreMakePurchase using some global var
or property. This starts the ball rolling and then messages from the store
are sent to "purchaseStateUpdate pPurchaseID, pProductID, pState" depending
on pState you either bail from a user's cancel or bad user credentials... or
confirm the purchase. When a final type of pstate is received then bail out
of the loop and let the user know the final status of the purchase attempt.

purchaseStateUpdate is just switch on pState with these cases
"SendingRequest, paymentReceived, alreadyEntitled, invalidSKU, complete,
restored, cancelled, error).

3) Setup your sandbox environment on both platforms. Apple is pretty
straight forward except you can never change a tester password, so if you
forget the password your done and have to make another tester username.
====>>>> Android does not allow a device using your PlayStore developer
Gmail account to make sandbox purchases. The device can never have been
logged into that account. I found the android sandbox device registration a
little wonky sometimes, but it will work.

On iOS You can also monitor the purchases/in-app purchase activities real
time via a web api that you create and host on your server. The format is
straight forward so LC server is your friend here. Then save the purchase
data in a DB. The PlayStore has an API that you can get purchase information
to load into a DB.

If you run into any snags give me a shout.

Ralph DiMola
IT Director
Evergreen Information Services
rdimola at evergreeninfo.net

-----Original Message-----
From: use-livecode [mailto:use-livecode-bounces at lists.runrev.com] On Behalf
Of J. Landman Gay via use-livecode
Sent: Tuesday, January 19, 2021 3:57 PM
To: LiveCode Mailing List
Cc: J. Landman Gay
Subject: In-app purchasing

Has anyone done in-app purchasing on iOS and Android? Does it work?

We're looking into possibly implementing this but I've never done it before.
Any tips welcome.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com

_______________________________________________
use-livecode mailing list
use-livecode at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list