Hello,
A few days ago I had a look at the new in-app purchase method.
While the routines are well documented I still have some questions about it.
(the initial thread is months old so I decided not to ask it there)
1. what is the use of this BILLING_KEY variable and what value should it have?
2. in some cases for example when google play is not installed we had to use try/catch to avoid crashes. this method also allowed us to remove the "remove ads" button as it wouldn't work anyway
is this new method crash proof? if so where should we check if billing client is working correct or not?
3. when pressing my button I get this fancy slide in one tap purchase menu but it mentiones that this is in test mode without charging.
is this because it detects that I'm using the same account on the phone than my dev account?
A few days ago I had a look at the new in-app purchase method.
While the routines are well documented I still have some questions about it.
(the initial thread is months old so I decided not to ask it there)
1. what is the use of this BILLING_KEY variable and what value should it have?
2. in some cases for example when google play is not installed we had to use try/catch to avoid crashes. this method also allowed us to remove the "remove ads" button as it wouldn't work anyway
is this new method crash proof? if so where should we check if billing client is working correct or not?
B4X:
'Initializes the object. You can add parameters to this method if needed.
Public Sub Initialize
try
billing.Initialize("billing")
inAppSupported=True ' <--- place here ???
catch
inAppSupported=False ' <--- place here ???
end try
RestorePurchases
End Sub
Private Sub RestorePurchases
Wait For (billing.ConnectIfNeeded) Billing_Connected (Result As BillingResult)
If Result.IsSuccess Then
inAppSupported=True ' <--- or use it here???
Wait For (billing.QueryPurchases("inapp")) Billing_PurchasesQueryCompleted (Result As BillingResult, Purchases As List)
Log("Query completed: " & Result.IsSuccess)
If Result.IsSuccess Then
For Each p As Purchase In Purchases
Log(p.sku)
If p.Sku = ADS_SDK_ID Then HandleAdsPurchase(p)
Next
End If
Else
inAppSupported=False ' <--- or use it here???
End If
End Sub
3. when pressing my button I get this fancy slide in one tap purchase menu but it mentiones that this is in test mode without charging.
is this because it detects that I'm using the same account on the phone than my dev account?