I have an application which has free version and user has 5 saves limit and payed version which user can save with no limit. How i will check on the begining of my program if user has all ready made the in app purchase and remove the limit?
I am receiving ERROR IAB HELPER NOT SETUP.... error. What i am doing wrong?
I am receiving ERROR IAB HELPER NOT SETUP.... error. What i am doing wrong?
B4X:
Activity_Create
tameio.Initialize("tameio", PrivateKey)
tameio.DebugLogging = True
tameio.GetOwnedProducts
Sub tameio_ownedProducts(Success As Boolean, purchases As Map)
Log(Success)
If Success Then
For Each p As Purchase In purchases.Values
Dim p As Purchase
If p.ProductId = "full_version" And p.PurchaseState = p.STATE_PURCHASED Then
HasApplicationBeenPayed = True
Else
HasApplicationBeenPayed = False
End If
Next
End If
End Sub
Sub tameio_BillingSupported (Supported As Boolean, Message As String)
If Supported Then tameio.GetOwnedProducts
End Sub
Sub tameio_PurchaseCompleted (Success As Boolean, Product As Purchase)
If Success = True Then
HasApplicationBeenPayed = True
ToastMessageShow("Thank you for your donation!",True)
TerminateMyApplication
Else
HasApplicationBeenPayed = False
End If
End Sub
Private Sub ButtonSaveRecord_Click
If HasApplicationBeenPayed = True Then
SaveRecord
Else if HasApplicationBeenPayed = False Then
If RecordsTable.GetRowCount < 4 Then
SaveRecord
Else If RecordsTable.GetRowCount >= 4 Then
Dim Purch As Purchase
Dim i As Int
Log(Purch.ProductId)
i = Msgbox2(PurchaseMessages(0),"title", PurchaseMessages(1),"Demo","",Null)
If i = DialogResponse.POSITIVE Then
tameio.RequestPayment("full_version","inapp","title" & Application.VersionName)
End If
End If
End If
End Sub
Last edited: