admin管理员组文章数量:1122846
So I have subscription enabled in google play for my flutter app. I am trying to create an offer on one of my subscriptions and customize it so that I can decide who can use this offer. I am using in_app_purchase package but I can't find any way to fetch the offer details and show pricing with and without offer based on a criteria set by me.
.SubscriptionOfferDetails
from here I can see that google billing library has ProductDetails.SubscriptionOfferDetails, but in_app_purchase doesn't seem to have anything like that to fetch offers and conditionally show the pricing.
I tried to do this, I imported these and found an object called SubscriptionOffersDetailsWrapper but can't seem to use it in any way I want.
import 'package:in_app_purchase_android/in_app_purchase_android.dart';
import 'package:in_app_purchase_android/billing_client_wrappers.dart';
final ProductDetailsResponse response =
await _inAppPurchase.queryProductDetails(_kIds);
if (response.error != null) {
// Handle the error
}
if (response.productDetails.isEmpty) {
print("why empty");
}
for(var x in response.productDetails){
if(x is GooglePlayProductDetails){
offer = SubscriptionOfferDetailsWrapper(basePlanId: basePlanId, offerTags: offerTags, offerIdToken: offerIdToken, pricingPhases: pricingPhases)
}
}
So I guess my question is that how can I conditionally show an offer in my flutter app with google play subscription. lets say I created an offer with my subscription that gives user 10% discount but only those users who in my app have listed sports as their hobby. In eligibility criteria of the offer I have selected developer determined.
But how to actually implement that in flutter.
本文标签: In flutter how to use google play subscription offer which is developer determinedStack Overflow
版权声明:本文标题:In flutter how to use google play subscription offer which is developer determined - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736301006a1931028.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论