Android Question In-App Billing: how to confirm its Set Up and Readiness

jai

Active Member
Licensed User
Longtime User
I am using In-app billing v3 and it runs fine most of the time but crashes at times with the following error-

Error occurred
Java language: illegalStateException: IAB helper is not set up. Can't perform
operation: queryinventory


The error seems to be triggered by the manager.GetOwnedProducts call at a time when IAB has not yet completed its set up.

I am initializing the IAB set up when Activity_Create executes the FirstTime with-
manager.Initialize("manager", key), and
manager.DebugLogging = True

The GetOwnedProducts call is embedded further down in the program. Often the IAB set up is complete by the time this call is executed but at other times it is not and I get the above error.

Is there a way to check if the IAB set up is completed before making the GetOwnedProducts call? Or, is there a work around this problem or an internal IAB variable name that would acknowledge its readiness?
 

jai

Active Member
Licensed User
Longtime User
Erel, how can I check to find out if the BillingSupported event has occurred?

I am under the impression that the following sub will get executed when this event occurs-
Sub Manager_BillingSupported (Supported As Boolean, Message As String)

But that is not the case. This sub does not get executed even though the IAB becomes active and it gets the
GetOwnedProducts information when BillingSupported is active. What do I need to check to insure the BillingSupported event has been fired before making other calls.

Thanks
 
Upvote 0

jai

Active Member
Licensed User
Longtime User
That's what is puzzling, the in-app billing service gets ready and brings in purchased product information in a later manager.GetOwnedProducts call but the following subroutine never gets executed-

Sub Manager_BillingSupported (Supported AsBoolean, Message AsString)

Log(Supported & ", " & Message)

Log("Subscriptions supported: " & manager.SubscriptionsSupported)

End Sub

Is there another way to find out if the in-app billing service is ready before making purchasing or inquiring calls?
Thanks.
 
Upvote 0

jai

Active Member
Licensed User
Longtime User
This update worked! It consistently raised BillingSupported as it should.
Erel, thank you very much for your prompt help with the solution.
 
Upvote 0
Top