Sub btnRemoveAds_Click
'make sure that the store service is connected
Wait For (billing.ConnectIfNeeded) Billing_Connected (Result As BillingResult)
If Result.IsSuccess Then
'get the sku details
Dim sf As Object = billing.QuerySkuDetails("subs", Array(ADS_SDK_ID))
Wait For (sf) Billing_SkuQueryCompleted (Result As BillingResult, SkuDetails As List)
' If Result.IsSuccess And SkuDetails.Size = 1 Then
' Result = billing.LaunchBillingFlow(SkuDetails.Get(0))
' If Result.IsSuccess Then Return
' End If
If Result.IsSuccess Then
If SkuDetails.Size > 0 Then
Dim offers As List = SkuDetails.Get(0).As(JavaObject).RunMethod("getSubscriptionOfferDetails", Null)
Dim offer As JavaObject = offers.Get(0)
Dim OfferToken As String = offer.RunMethod("getOfferToken", Null)
' Result = billing.LaunchBillingFlow(SkuDetails.Get(0))
Result = LaunchBillingFlow(billing, SkuDetails.Get(0), OfferToken)
If Result.IsSuccess Then Return
Else
ToastMessageShow("Error SKU not found", True)
Return
End If
End If
End If
ToastMessageShow("Error starting billing process", True)
End Sub