I am testing the new GooglePlayBilling library v7.00
I get an error on line #99 when calling LaunchBillingFlow for subscriptions.
SkuDetails.Get(0) has value:
ProductDetails{jsonString='{"productId":"weekly_1","type":"subs","title":"Weekly RM1.99 (In App Billing Demo)","name":"Weekly RM1.99","description":"Weekly Subscription for RM1.99 only","localizedIn":["en-US"],"skuDetailsToken":"AEuhp4JcTcV5...","subscriptionOfferDetails":[{"offerIdToken":"AZbOM32R2\/CPjBmc...==","basePlanId":"p1w","pricingPhases":[{"priceAmountMicros":1990000,"priceCurrencyCode":"MYR","formattedPrice":"RM 1.99","billingPeriod":"P1W","recurrenceMode":1}],"offerTags":[]}]}', parsedJson={"productId":"weekly_1","type":"subs","title":"Weekly RM1.99 (In App Billing Demo)","name":"Weekly RM1.99","description":"Weekly Subscription for RM1.99 only","localizedIn":["en-US"],"skuDetailsToken":"AEuhp4JcTcV5...=","subscriptionOfferDetails":[{"offerIdToken":"AZbOM32R2\/CPjBmc...==","basePlanId":"p1w","pricingPhases":[{"priceAmountMicros":1990000,"priceCurrencyCode":"MYR","formattedPrice":"RM 1.99","billingPeriod":"P1W","recurrenceMode":1}],"offerTags":[]}]}, productId='weekly_1', productType='subs', title='Weekly RM1.99 (In App Billing Demo)', productDetailsToken='AEuhp4JcTcV5...=', subscriptionOfferDetails=[com.android.billingclient.api.ProductDetails$SubscriptionOfferDetails@f93a1b]}
Error logs:
I get an error on line #99 when calling LaunchBillingFlow for subscriptions.
B4X:
Result = billing.LaunchBillingFlow(SkuDetails.Get(0))
SkuDetails.Get(0) has value:
ProductDetails{jsonString='{"productId":"weekly_1","type":"subs","title":"Weekly RM1.99 (In App Billing Demo)","name":"Weekly RM1.99","description":"Weekly Subscription for RM1.99 only","localizedIn":["en-US"],"skuDetailsToken":"AEuhp4JcTcV5...","subscriptionOfferDetails":[{"offerIdToken":"AZbOM32R2\/CPjBmc...==","basePlanId":"p1w","pricingPhases":[{"priceAmountMicros":1990000,"priceCurrencyCode":"MYR","formattedPrice":"RM 1.99","billingPeriod":"P1W","recurrenceMode":1}],"offerTags":[]}]}', parsedJson={"productId":"weekly_1","type":"subs","title":"Weekly RM1.99 (In App Billing Demo)","name":"Weekly RM1.99","description":"Weekly Subscription for RM1.99 only","localizedIn":["en-US"],"skuDetailsToken":"AEuhp4JcTcV5...=","subscriptionOfferDetails":[{"offerIdToken":"AZbOM32R2\/CPjBmc...==","basePlanId":"p1w","pricingPhases":[{"priceAmountMicros":1990000,"priceCurrencyCode":"MYR","formattedPrice":"RM 1.99","billingPeriod":"P1W","recurrenceMode":1}],"offerTags":[]}]}, productId='weekly_1', productType='subs', title='Weekly RM1.99 (In App Billing Demo)', productDetailsToken='AEuhp4JcTcV5...=', subscriptionOfferDetails=[com.android.billingclient.api.ProductDetails$SubscriptionOfferDetails@f93a1b]}
Error logs:
Query (subs) completed: true <-- Result.IsSuccess from Billing_PurchasesQueryCompleted
[] <-- Purchases.As(Object)
Error occurred on line: 99 (Main)
java.lang.NullPointerException: offerToken is required for constructing ProductDetailsParams for subscriptions.
at com.google.android.gms.internal.play_billing.zzaa.zzc(com.android.billingclient:billing@@7.0.0:1)
at com.android.billingclient.api.BillingFlowParams$ProductDetailsParams$Builder.build(com.android.billingclient:billing@@7.0.0:3)
at anywheresoftware.b4a.objects.BillingClientWrapper.LaunchBillingFlow(BillingClientWrapper.java:263)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.shell.Shell.runMethod(Shell.java:732)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:348)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:255)
at java.lang.reflect.Method.invoke(Native Method)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:157)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:201)
at anywheresoftware.b4a.shell.DebugResumableSub$RemoteResumableSub.resume(DebugResumableSub.java:22)
at anywheresoftware.b4a.BA.checkAndRunWaitForEvent(BA.java:275)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:150)
at anywheresoftware.b4a.BA$2.run(BA.java:395)
at android.os.Handler.handleCallback(Handler.java:794)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:176)
at android.app.ActivityThread.main(ActivityThread.java:6651)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:824)