Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
DataFolder = File.DirData("GooglePlayDeveloper")
oauth2.Initialize(Me, "oauth2", ClientId, "https://www.googleapis.com/auth/androidpublisher", _
ClientSecret, DataFolder)
Test("my.package.name")
End Sub
Sub Test (PackageName As String)
oauth2.GetAccessToken
Wait For OAuth2_AccessTokenAvailable (Success As Boolean, Token As String)
If Success = False Then
Log("Error accessing account.")
Return
End If
Dim j As HttpJob
j.Initialize("", Me)
j.Download("https://www.googleapis.com/androidpublisher/v2/applications/my.package.name/purchases/products/my.package.name.in-app-sku-here/tokens/purchaseToken_from_B4A_when_the_in_app_purchase_was_made")
j.GetRequest.SetHeader("Authorization", "Bearer " & Token)
Wait For (j) JobDone(j As HttpJob)
If j.Success Then
Log(j.GetString)
Else
Log("Online data not available.")
End If
j.Release
Log("Done!!!")
ExitApplication
End Sub