I have received a few emails from users unable to restore their previous in-app purchase. Version 1.0 of this app was developed with a different framework, and version 2.0 was recently released built on B4i. There is only 1 IAP (pro upgrade). I'm not sure if the issue is arising from my code, due to using new certificates, or another issue. Any help would be appreciated.
B4X:
Sub msgPurchase_Click(sel As String)
Select sel
Case "Upgrade"
If MyStore.CanMakePayments = False Then
hd.ToastMessageShow("Device unable to make purchases at this time",False)
Else
MyStore.RequestPayment("com.my.unlock")
End If
Case "Cancel"
Log("Canceled")
Case "Restore"
MyStore.RestoreTransactions
End Select
End Sub
Sub MyStore_Purchase
Msgbox2("msgPurchase","Upgrade for $0.99","Locked", Array As String("Upgrade","Restore Purchase","Cancel"))
End Sub
Public Sub MyStore_PurchaseCompleted (Success As Boolean, Product As Purchase)
If Success = True Then
unlocked = "Yes"
imgLock.Visible = False
Map1.Put("unlocked","Yes")
File.WriteMap(File.DirDocuments, "Map.dat", Map1)
hd.ToastMessageShow("App unlocked!",False)
Else
unlocked = "No"
hd.ToastMessageShow("Purchase/Restore failed",False)
End If
End Sub