purchases-android
purchases-android copied to clipboard
subscriptionPeriod is null
Describe the bug Recently experiencing a rare but annoying issue where StoreProduct.subscriptionPeriod is null which leads to a crash in our case. I guess it could be avoided by handling this specific case and skipping StoreProduct objects with null subscriptionPeriod. But then what happens to the user who is not able to proceed to the payment.
- Environment
- Platform: Android
- SDK version: 5.8.2 (waiting a bit more to upgrade to the 6.x)
- OS version: 10, 12, 13..
- Android Studio version: last stable - Android Studio Electric Eel | 2022.1.1 Patch 2
- How widespread is the issue. Percentage of devices affected: low which makes me believe the issue could come on your side or google's
Not reproduced in local environment
👀 SDKONCALL-251 We've just linked this issue to our internal tracker and notified the team. Thank you for reporting, we're checking this out!
Hi @Toubap, thanks for reaching out! Let me try to help you.
In 5.8.2, there are two situations where StoreProduct.subscriptionPeriod could be null:
- If it's a non-subscription product (an
In-app productwithin the Play store console). - If it's an Amazon product.
Do you have any products matching that situation? If that's not your issue, could you share a code snippet of how you're obtaining your StoreProduct's along with some logs of that flow so it's easier to debug?
Here's what I get from the StoreProduct
StoreProduct(sku=xxx, type=SUBS, price=$18.00 , priceAmountMicros=18000000, priceCurrencyCode=USD, originalPrice=$18.00 , originalPriceAmountMicros=18000000, title=xxx , description=xxx , subscriptionPeriod=null, freeTrialPeriod=null, introductoryPrice=null, introductoryPriceAmountMicros=0, introductoryPricePeriod=null, introductoryPriceCycles=0, iconUrl=, originalJson={"productId":"xxx","type":"subs","price":"$18.00 ","title":"xxx","name":"xxx","localizedIn":["de_DE","en_AU","en_CA","en_GB","en_IN","en_SG","en-US","en_ZA","fr_CA","fr_FR","ja_JP","ko_KR","zh_CN","zh_HK","zh_TW"],"description":"xxx","price_amount_micros":18000000,"price_currency_code":"USD","skuDetailsToken":"xxx","subscriptionOfferDetails":[{"offerIdToken":"xxx","pricingPhases":[{"priceAmountMicros":18000000,"priceCurrencyCode":"USD","formattedPrice":"$18.00 ","billingPeriod":"P1M","recurrenceMode":1}],"offerTags":["baseplan"]}]})
Its not an in app purchase nor an amazon product
initially obtained through getOfferingsWith
Hi @Toubap,
Unfortunately I'm not able to repro the issue. Could you share a snippet of your call to getOfferingsWith along with how you're getting this StoreProduct and also share the logs before this happens?