adaptyteam / AdaptySDK-Flutter

SDK for growing mobile in-app purchases
https://docs.adapty.io/docs/quickstart
MIT License
88 stars 15 forks source link

The same paywall is available for free trial information in the Android native SDK, but not in flutter SDK 2.6.2 #93

Closed LuoChengAndroid closed 10 months ago

LuoChengAndroid commented 11 months ago

The following is printed information for the Android SDK

AdaptyPaywallProduct(vendorProductId=test_yearly, localizedTitle=Test Yearly Product , localizedDescription=, paywallName=test paywall, paywallABTestName=test paywall, variationId=7b63310d-cf9e-482c-9d72-da1386997378, price=Price(amount=469, localizedString=HK$469.00, currencyCode=HKD, currencySymbol=$), subscriptionDetails=com.adapty.models.AdaptyProductSubscriptionDetails@cee6a6b, productDetails=ProductDetails{jsonString='{"productId":"test_yearly","type":"subs","title":"Test Yearly Product ","name":"Test Yearly Product","localizedIn":["en-US"],"skuDetailsToken":"AEuhp4IYoRAXUMYl779VSZrqCIxvVjl4EZztjfK_2VVJcYblStRX_fbmQmWgz4xvm_gt","subscriptionOfferDetails":[{"offerIdToken":"AUj\/Yhil146KKInjGLramQRWsVgKrCK1IKTkvOVYhVz7CatEGsTAZVN3IkOHotmc1Cy8cR0RMSIpzCDv0\/e09LP\/qboDPBCVQkpNocXH6CV1ZnYgOoTPa9EU2MW6t+s2Xia3z5KHYmj7fjKZL3z14580El6pcIaL","basePlanId":"yearly-test","offerId":"test-yearly-freetrial","pricingPhases":[{"priceAmountMicros":0,"priceCurrencyCode":"HKD","formattedPrice":"免費","billingPeriod":"P1W","recurrenceMode":2,"billingCycleCount":1},{"priceAmountMicros":469000000,"priceCurrencyCode":"HKD","formattedPrice":"HK$469.00","billingPeriod":"P1Y","recurrenceMode":1}],"offerTags":[]},{"offerIdToken":"AUj\/YhhGJ1XQJZ3tCKpx\/o6ojGB48z2xdN1irXQv37ksjNLZXlXwaaArqeSAHu6pZOp3gSB2OSAFtiUT0Nxc4jHUt4rQaaVCH\/730nv38pExCKqCcLMVjYxP1g==","basePlanId":"yearly-test","pricingPhases":[{"priceAmountMicros":469000000,"priceCurrencyCode":"HKD","formattedPrice":"HK$469.00","billingPeriod":"P1Y","recurrenceMode":1}],"offerTags":[]}]}', parsedJson={"productId":"test_yearly","type":"subs","title":"Test Yearly Product ","name":"Test Yearly Product","localizedIn":["en-US"],"skuDetailsToken":"AEuhp4IYoRAXUMYl779VSZrqCIxvVjl4EZztjfK_2VVJcYblStRX_fbmQmWgz4xvm_gt","subscriptionOfferDetails":[{"offerIdToken":"AUj\/Yhil146KKInjGLramQRWsVgKrCK1IKTkvOVYhVz7CatEGsTAZVN3IkOHotmc1Cy8cR0RMSIpzCDv0\/e09LP\/qboDPBCVQkpNocXH6CV1ZnYgOoTPa9EU2MW6t+s2Xia3z5KHYmj7fjKZL3z14580El6pcIaL","basePlanId":"yearly-test","offerId":"test-yearly-freetrial","pricingPhases":[{"priceAmountMicros":0,"priceCurrencyCode":"HKD","formattedPrice":"免費","billingPeriod":"P1W","recurrenceMode":2,"billingCycleCount":1},{"priceAmountMicros":469000000,"priceCurrencyCode":"HKD","formattedPrice":"HK$469.00","billingPeriod":"P1Y","recurrenceMode":1}],"offerTags":[]},{"offerIdToken":"AUj\/YhhGJ1XQJZ3tCKpx\/o6ojGB48z2xdN1irXQv37ksjNLZXlXwaaArqeSAHu6pZOp3gSB2OSAFtiUT0Nxc4jHUt4rQaaVCH\/730nv38pExCKqCcLMVjYxP1g==","basePlanId":"yearly-test","pricingPhases":[{"priceAmountMicros":469000000,"priceCurrencyCode":"HKD","formattedPrice":"HK$469.00","billingPeriod":"P1Y","recurrenceMode":1}],"offerTags":[]}]}, productId='test_yearly', productType='subs', title='Test Yearly Product', productDetailsToken='AEuhp4IYoRAXUMYl779VSZrqCIxvVjl4EZztjfK_2VVJcYblStRX_fbmQmWgz4xvm_gt', subscriptionOfferDetails=[com.android.billingclient.api.ProductDetails$SubscriptionOfferDetails@f5e14e5, com.android.billingclient.api.ProductDetails$SubscriptionOfferDetails@38adbba]})

Below is the print information for flutter SDK

[(vendorProductId: test_yearly, localizedDescription: , localizedTitle: Test Yearly Product, regionCode: null, isFamilyShareable: false, paywallVariationId: 7b63310d-cf9e-482c-9d72-da1386997378, paywallABTestName: test paywall, paywallName: test paywall, price: (amount: 469.0, currencyCode: HKD, currencySymbol: $, localizedString: HK$469.00), subscriptionDetails: (subscriptionGroupIdentifier: null, subscriptionPeriod: (unit: AdaptyPeriodUnit.year, numberOfUnits: 1), localizedSubscriptionPeriod: 1年, introductoryOffer: [], promotionalOffer: null, androidOfferId: null, androidBasePlanId: yearly-test, androidOfferTags: [], renewalType: AdaptyRenewalType.autorenewable, _androidIntroductoryOfferEligibility: AdaptyEligibility.ineligible))]

Arcturus5404 commented 10 months ago

Experiencing the same issue. The Android free trial is not shown in 2.6.2.

We had to revert back to 2.4.4.

Any news on when 2.6.x has the Android Offers?

vladd-g commented 10 months ago

Hi @LuoChengAndroid

Could you please check whether you've added an offer to the paywall? Since a product can be purchased with various of its offers or with no offer at all, it's important to specify an offer on the specific paywall

LuoChengAndroid commented 10 months ago

Hi @LuoChengAndroid

Could you please check whether you've added an offer to the paywall? Since a product can be purchased with various of its offers or with no offer at all, it's important to specify an offer on the specific paywall

The same paywall is available for free trial information in the Android native SDK, but not in flutter SDK 2.6.2。

I have provided the corresponding printing information above,I'm sure the offer was added to the paywall

vladd-g commented 10 months ago

@LuoChengAndroid did you test both cases with the same Google account? Could you please double check that the account you test Flutter with is eligible for the free trial according to Play Market? The printed info looks like either the offer was not present on the paywall, or was not eligible on the Google side for this test account

LuoChengAndroid commented 10 months ago

@LuoChengAndroid did you test both cases with the same Google account? Could you please double check that the account you test Flutter with is eligible for the free trial according to Play Market? The printed info looks like either the offer was not present on the paywall, or was not eligible on the Google side for this test account

I used the same account to test two SDKS, and the result was that flutter SDK did not have corresponding data. I also used other accounts to test, and the result was the same: the offer information was in the Android SDK, but not in the flutter SDK

vladd-g commented 10 months ago

@LuoChengAndroid Could you please send the logs of this flow from Flutter SDK (that start with "Adapty_v2.6.2" – it's important) to support@adapty.io? Please also add the link to the issue in your email so that we know the context

LuoChengAndroid commented 10 months ago

@LuoChengAndroid Could you please send the logs of this flow from Flutter SDK (that start with "Adapty_v2.6.2" – it's important) to support@adapty.io? Please also add the link to the issue in your email so that we know the context

The email has been sent

vladd-g commented 10 months ago

@LuoChengAndroid Thank you, replied

Arcturus5404 commented 9 months ago

Can you please share the solution? I am still facing this issue!

vladd-g commented 9 months ago

@Arcturus5404 Is the Google account you're testing on eligible for the trial? From version 2.4.4 to 2.6.2, we migrated the Billing Library from v4 to v6, and starting from version 5, it doesn't return offers that a user is not eligible for.

Arcturus5404 commented 9 months ago

Does that also mean that if I already tested this offer before, my test account is not eligible anymore?

vladd-g commented 9 months ago

@Arcturus5404 It depends on the way the offer is configured in the Play Console. You can test with an offer that has Developer determined eligibility criteria.

LuoChengAndroid commented 9 months ago

I'm using Adapty flutter sdk V2.7.0 right now

I discovered something when I was debugging the code,

But I'm not very good at Kotlin, I hope you can check it out

When this function is called, it changes when the result is converted image

This is the data for one of the products

1696756440791

After the conversion, flutter returns something like this

1696756567894

This is obviously missing a lot of data, like subscriptionOfferDetails, but I don't know how to find it please

vladd-g @.***> 于2023年10月7日周六 18:40写道:

@Arcturus5404 https://github.com/Arcturus5404 Is the Google account you're testing on eligible for the trial? From version 2.4.4 to 2.6.2, we migrated the Billing Library from v4 to v6, and starting from version 5, it doesn't return offers that a user is not eligible for.

— Reply to this email directly, view it on GitHub https://github.com/adaptyteam/AdaptySDK-Flutter/issues/93#issuecomment-1751678171, or unsubscribe https://github.com/notifications/unsubscribe-auth/AYU4MGP7FZ7JUP5LDC26ZNTX6EWQ7AVCNFSM6AAAAAA34M7NB6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONJRGY3TQMJXGE . You are receiving this because you were mentioned.Message ID: @.***>

vladd-g commented 9 months ago

@LuoChengAndroid the images are not visible, could you please edit the comment and attach them?

LuoChengAndroid commented 9 months ago

@LuoChengAndroid the images are not visible, could you please edit the comment and attach them?

I am very sorry, I have completed the picture, now you can see

vladd-g commented 9 months ago

This is obviously missing a lot of data, like subscriptionOfferDetails

It's a part of the native Product implementation from the Billing Library that isn't passed to the Flutter side; the relevant offer info is passed differently.

vladd-g commented 9 months ago

@LuoChengAndroid like you did on the second screenshot, could you please evaluate product.subscriptionDetails?.introductoryOfferEligibility on the product that, you suppose, lacks the offer data? and product.subscriptionDetails?.introductoryOfferPhases

LuoChengAndroid commented 9 months ago

@LuoChengAndroid like you did on the second screenshot, could you please evaluate on the product that, you suppose, lacks the offer data? and product.subscriptionDetails?.introductoryOfferEligibility``product.subscriptionDetails?.introductoryOfferPhases

I checked these two data, and it shows that my account has no permission, but V2.4.4 version shows that I have permission, which makes me very confused, maybe there is something wrong with the configuration of our Google Play Console, I need to investigate first, thank you very much for your work

LuoChengAndroid commented 9 months ago

@vladd-g hi, We checked our configuration and found nothing wrong I then called the Google billing v6.0.1 SDK and found that a free trial was available

Below I tested the same subscription product using the same account

The payment page awakened by the Google billing v6.0.1 SDK is used here 1697020019101

The payment page awakened by the adapty Android V2.6.2 SDK is used here 1697020142414

The adapty flutter V2.7.0 SDK is used here to wake up the payment page 1697020079325

Only the Google billing v6.0.1 SDK is available for a free trial I don't know why this is happening, it's confusing to me

vladd-g commented 9 months ago

@LuoChengAndroid

The payment page awakened by the adapty Android V2.6.2 SDK is used here

It's the native Android SDK (not Flutter), right? Could you please filter the native logs with "Adapty_v2.6.2" and try finding the following line: Offer YOUR_OFFER_ID was not found for the base plan YOUR_BASE_PLAN_ID for the product YOUR_PRODUCT_ID (parts in caps are placeholders)

I suppose your offer id is either missing in the Paywall, or doesn't equal to the one from Play Console

LuoChengAndroid commented 9 months ago

@LuoChengAndroid

The payment page awakened by the adapty Android V2.6.2 SDK is used here

It's the native Android SDK (not Flutter), right? Could you please filter the native logs with "Adapty_v2.6.2" and try finding the following line: (parts in caps are placeholders)Offer YOUR_OFFER_ID was not found for the base plan YOUR_BASE_PLAN_ID for the product YOUR_PRODUCT_ID

I suppose your offer id is either missing in the Paywall, or doesn't equal to the one from Play Console

It is a native Android SDK, sorry I did not find the corresponding prompt in the related log image

vladd-g commented 9 months ago

@LuoChengAndroid On the screenshot I see "offer_id":null for both products

Could you please specify the offer in the paywall in Adapty dashboard?

LuoChengAndroid commented 9 months ago

@vladd-g

Could you please specify the offer in the paywall in Adapty dashboard?

Thank you very much. I have informed my O&M colleagues to add corresponding content in the Adapty dashboard, and I will verify it as soon as possible

LuoChengAndroid commented 9 months ago

@vladd-g Thank you very much, now I can get the free trial information, forgive me for not having permission to manage the Adapty dashboard, my colleagues do not know about these changes, everything is fine now