In App Billing changes?

canalrun

Well-Known Member
Licensed User
Longtime User
Hello,
I have used In App Billing successfully for several applications – between about March and August of this year.

I basically copied Erel's tutorial code for my implementation.

With the same code in my current application, I am not receiving any responses in Sub Manager_PurchaseStateChange(PurchaseState ...

B4X:
Sub Manager_PurchaseStateChange(PurchaseState As Int, ProductId As String, OrderId As String, _
  PurchaseTime As Long, ExtraData As String)
  Dim PSCArray(5) As Object
  
Log("PuchStChg = " & PurchaseState & " " & ProductId) ' *--*

  PSCArray(0) = PurchaseState
  PSCArray(1) = ProductId
  PSCArray(2) = OrderId
  PSCArray(3) = PurchaseTime
  PSCArray(4) = ExtraData

  If (PurchaseState = Manager.PURCHASE_STATE_PURCHASED) Then
   CallSubDelayed2(Main, "PurchSuccess", PSCArray)
  Else If (PurchaseState = Manager.PURCHASE_STATE_CANCELED) Then
    CallSubDelayed2(Main, "PurchCancelled", PSCArray)
  End If
End Sub

The first meaningful statement of this subroutine is a Log(). If this routine is ever called it should show up in the application logs (yes, I see other log statements displayed for the running application as they should be).

Earlier this year when I tried test purchases or actual product purchases in my apps I would receive confirmation.

In my current app, for both test purchases and product purchases, the purchase appears in the Google Check out Dashboard, but I do not receive any notification of the purchase – the Log statement never gets executed.

A while after one purchase I did see a "Google Play" notification flash in the notification bar, but that was once out of maybe a dozen purchases and I did not receive any PurchaseStateChange function call.

I think B4A version 1.9 was the last version for which I received successful In App Purchase responses. I'm currently using the latest, B4A 2.22?.

My question is has anything changed that may affect the in app billing library? Has anybody else had successes or problems recently? Or can offer any suggestions?

Thanks,
Barry.


Added a little later…

I disabled filtering from the logs. Here is a snippet between my purchase and an error I think may be significant.

B4X:
Donate = gtk.donate
...
...
...
[1] IntentUtils.createIntentForReceiver: Could not find receiver for canalrun.apps.gpstrak
[1] MarketBillingService.sendResponseCode: Response RESULT_OK cannot be delivered to canalrun.apps.gpstrak. Intent does not resolve.
 
Last edited:

canalrun

Well-Known Member
Licensed User
Longtime User
:eek:

I think I found my problem. I forgot to add the in app billing changes to the manifest file.

I haven't had a chance to try it, but I'm sure this will solve the problem.

Thanks,
Barry.
 
Upvote 0
Top