Android Question Help! Help!Help! with In App Billing API

pfillion

Member
Licensed User
Longtime User
Hi,

I am using the in app billing module "InAppBilling3 (version 1.00)" library. I made a lot of tests with my app in dev. Everything seems fine in dev. It check for my product and receive a confirmation that it has been bought. Everything was great until 2 days ago.

I released my application and got like 4 to 5 users who report that my app does not unlock when they donated. I check their order number and it is valid. I sent them a some debug code and the check for product report that they do not own any product.

I bought my own app for real (not as a tester) with another device and got problems... here is my code and the result of the transaction...

Note: The app is free but had an inapp product that can be bought...

Anybody know what I'm doing wrong ? Like you guess I have some angry user who are wondering why it is not working!

Help!!

B4X:
Sub Activity_Create(FirstTime AsBoolean)
...
manager.Initialize("manager", key)
manager.DebugLogging = True   
...

B4X:
Sub manager_OwnedProducts (Success As Boolean, purchases As Map)
      'Log(Success)
    IsDonation = False
   
    If Success Then
        'Log(purchases)
 
        For Each p As Purchase In purchases.Values
            'Log(p.ProductId & ", Purchased? " & (p.PurchaseState = p.STATE_PURCHASED))
            If p.ProductId = "stay_alive_donation" Then
                If p.PurchaseState = p.STATE_PURCHASED Then
                    IsDonation = True
                End If
            End If
        Next
    End If
   
    'Initialize and update the donation status
    UpdateDonationStatus
   
End Sub

B4X:
Sub manager_PurchaseCompleted (Success As Boolean, Product As Purchase)
 
'Log("manager_PurchaseCompleted:" & Success & " - " & Product)
 
 
    If Success = True Then
      IsDonation = True
      ToastMessageShow("Thank you for your donation!",True)
       'Terminate the activity to force to user to go back to the menu with a refresh donation status
      Activity.Finish
    Else
        IsDonation = True
        ToastMessageShow("Please consider donating to support this AD Free application!",True)
        ToastMessageShow("Please wait or reinstall the application if license status is wrong!",True)
    End If 
End Sub

B4X:
...
'Request payment
manager.RequestPayment("stay_alive_donation","inapp","synetics")
...

Here is what I get when I try to buy a valid licence for my in app product


If I try to buy again...

If I try licence check when I restart app... it fails...

I was wondering what is wrong with my code because this test worked with success on my dev device...
 

pfillion

Member
Licensed User
Longtime User
Ok I found my problem.

I don't know why as I only open 1 developer account with Google... My public key was wrong. I don't know how come it has changed...

Now my purchase and verification checks work. I'm just not sure why users got charged anyway... and don't know if the current purchase will be detected with the new key or if I will have to refund and ask them to purchase again...



Anyone know how much time it takes when you cancel an order and verify the inapp purchase for it to actually be cancelled.

I bought an inapp product to test with another account on another device. Canceled the purchase, got my cancellation email from Google but app still see the inapp product as valid...
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…