IAP in App Store

Ralph DiMola rdimola at evergreeninfo.net
Thu Oct 7 13:49:18 EDT 2021


"complete" status only means that the process is complete. A purchase is
only complete if "complete" is preceded by a "paymentReceived" or in the
case of a user with a new device "restored". At least that's the way I
understand it. This logic has worked for me.

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: Wednesday, October 06, 2021 4:33 PM
To: How to use LiveCode
Cc: J. Landman Gay
Subject: Re: IAP in App Store

I'm confused about how the purchase flow works so my question is probably
incorrect. There is no error when I see the "complete" status, it only shows
up in my logging file. After adding additional logging, it looks like
"complete" is sent after every transaction. But if something goes wrong,
like asking for a product that isn't in the Play Store yet, there are no
status reports except "complete." The app doesn't receive any other info and
Android doesn't display any dialog. Seems like I should get an "invalid sku"
status error.

Here's part of the log where I made a successful test purchase (product ID
obscured):

***
Wed, 6 Oct 2021 14:12:55 -0500 BEGIN IAP PURCHASE: <PRODUCT ID>
   -- purchaseStateUpdate logs this:
Wed, 6 Oct 2021 14:13:15 -0500 Purchase state: <PRODUCT ID> paymentReceived
| PurchaseID: 3

   -- fullfillment handler logs this and sends info to back end server:
Wed, 6 Oct 2021 14:13:15 -0500 Purchase complete: true | <PRODUCT ID> |
paymentReceived Wed, 6 Oct 2021 14:13:15 -0500 queryServer about to query
for newPurchase Wed, 6 Oct 2021 14:13:15 -0500 newPurchase params:
{"packageid": "<PRODUCT 
ID>","transaction_id": "3","source": "android"}

   -- and finally purchaseStateUpdate returns "complete":
Wed, 6 Oct 2021 14:13:15 -0500 Purchase state: <PRODUCT ID> complete |
PurchaseID: 3
***

I'm working in the internal test track and the choices in the test purchase
dialog do not include a Cancel button. To cancel, I tap outside the dialog
and it goes away. Sometimes I get an email about my "purchase" (which is
normal) and usually it verifies a cancellation. But one email had some
additional test info:

"This test purchase was cancelled because it was not acknowledged. You
should ensure all purchases are acknowledged so they are not subject to
refunds. For more information see
https://developer.android.com/google/play/billing/integrate#process."

I just repeated the same cancellation method just now and did not get that
warning in email. I didn't actually get an email at all.

One faintly amusing thing is that Google is counting my unpaid test
purchases as real ones in their Play Points history, and yesterday I
acquired enough points to rent a free movie and advance to level Silver for
additional benefits. :)

Given how complex their IAP store setup is, I think that's only fair.


On 10/6/21 11:40 AM, panagiotis m via use-livecode wrote:
> Hello Jacque,
> 
> What is the exact error that causes purchaseStateUpdate to be sent 
> with a "complete" status?
> Google is supposed to show its own notification in most cases, so 
> that's fine, but then the purchaseStateUpdate should be sent with an 
> appropriate status anyway.
> 
> Kind regards,
> Panos
> --
> 
> 
> 
> On Tue, 5 Oct 2021 at 20:54, J. Landman Gay via use-livecode < 
> use-livecode at lists.runrev.com> wrote:
> 
>> I guess this is for @Panos.
>>
>> Now that I have IAP working I noticed another thing. I'm building for 
>> Android with LC 9.6.5
>> RC-1 which includes the new billing library. My script has a 
>> purchaseStateUpdate handler that logs every response and sends the 
>> info to a IAPPurchaseComplete handler that manages the purchase or 
>> the error. If there is an error this handler puts up a dialog 
>> informing the user.
>>
>> I notice any error is not received by the handler, instead Google 
>> puts up its own notification and the status returns as "complete". My 
>> notification never runs. That's fine and it looks better than my own 
>> but I'm curious whether something has changed in the new billing 
>> library, and if so, what.
>>
>> --
>> 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
>>
> _______________________________________________
> 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
> 


-- 
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