Private Sub MyStore_PurchaseCompleted (Success As Boolean, Product As Purchase)
Dim PurchaseTime As Long
Dim mp As Map
mp.Initialize
'Log("Success = " & Success)
If Success Then
If Product.IsInitialized Then
Select Product.ProductIdentifier
Case Product_1year
PurchaseTime = DateTime.Add(Product.TransactionDate,1,0,0)
Case Product_6month
PurchaseTime = DateTime.Add(Product.TransactionDate,0,6,0)
Case Product_1month
PurchaseTime = DateTime.Add(Product.TransactionDate,0,1,0)
Case Product_noad
PurchaseTime = DateTime.Add(Product.TransactionDate,20,0,0) ' 20 Jahre hinzufügen nur damit die Lizenz nie ablauft.
End Select
Dim lizenzkey As String = mAllg.GUID 'A new license key is generated here.
'A dialog box with the license key is displayed here.
InfoAboutProductPurchased(lizenzkey)
Dim p As Phone
p.KeyChainPut(mAllg.GetPackageName, Product.ProductIdentifier & ";" & Product.TransactionIdentifier & ";" & Product.TransactionDate & ";" & PurchaseTime & ";" & lizenzkey)
mp = getLizenzFileMap
mAllg.MapToLizenzfile(mp, "temp.lic")
'Kunde in der Online-Datenbank speichern
CallSub3(Me, "CheckInternetConnection", IdLizenzedUser, Product.TransactionIdentifier)
End If
End If
HD.ProgressDialogHide
End Sub