MethodChannelInappPurchase class
基于MethodChannel的应用内购实现
- Inheritance
-
- Object
- PlatformInterface
- InappPurchasePlatform
- MethodChannelInappPurchase
Constructors
- MethodChannelInappPurchase()
- 构造函数
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- methodChannel → MethodChannel
-
方法通道
final
-
onProductsLoaded
→ Stream<
List< Map< >String, dynamic> > -
产品加载完成流
no setteroverride
-
onPurchasedTransactionsUpdated
→ Stream<
Map< String, dynamic> > -
交易更新流
no setteroverride
-
onStateChanged
→ Stream<
Map< String, dynamic> > -
状态变化流
no setteroverride
- productsEventChannel → EventChannel
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stateEventChannel → EventChannel
-
事件通道
final
- transactionsEventChannel → EventChannel
-
final
Methods
-
checkSubscriptionStatus(
) → Future< bool> -
检查订阅状态
override
-
configure(
{required List< String> productIds, required List<String> lifetimeIds, int nonRenewableExpirationDays = 7, bool autoSortProducts = true, bool showLog = true}) → Future<void> -
配置产品
override
-
getAllProducts(
) → Future< List< Product> > -
获取所有产品信息
override
-
getAutoRenewablesProducts(
) → Future< List< Product> > -
获取自动续订订阅产品信息
override
-
getConsumablesProducts(
) → Future< List< Product> > -
获取消耗型产品信息
override
-
getLatestTransactions(
) → Future< List< Transaction> > -
获取每个产品的最新交易信息(包含已过期交易,每个ID对应一个交易)
override
-
getNonConsumablesProducts(
) → Future< List< Product> > -
获取非消耗型产品信息
override
-
getNonRenewablesProducts(
) → Future< List< Product> > -
获取非自动续订订阅产品信息
override
-
getPlatformVersion(
) → Future< String?> -
获取平台版本
override
-
getProduct(
{required String productId}) → Future< Product?> -
获取产品信息
override
-
getProductForVipButtonText(
{required String productId, required String langCode}) → Future< String> -
获取VIP订阅产品的按钮文本
productId产品IDlangCode语言代码,例如"en"、"zh-Hans"等override -
getProductForVipSubtitle(
{required String productId, required String periodType, required String langCode}) → Future< String> -
获取VIP订阅产品的描述
productId产品IDoverride -
getProductForVipTitle(
{required String productId, required String periodType, required String langCode}) → Future< String> -
获取VIP订阅产品的副标题
productId产品IDoverride -
getValidPurchasedTransactions(
) → Future< List< Transaction> > -
获取有当前有效购买交易信息
override
-
isEligibleForIntroOffer(
{required String productId}) → Future< bool> -
检查是否符合享受介绍性优惠资格
override
-
检查产品是否通过家庭共享获得
override
-
isPurchased(
{required String productId}) → Future< bool> -
检查产品是否已购买
override
-
isSubscribedButFreeTrailCancelled(
{required String productId}) → Future< bool> -
检查产品是否在有效订阅期间内但在免费试用期已取消
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
presentOfferCodeRedeemSheet(
) → Future< bool> -
打开介绍性优惠码兑换页面
override
-
purchase(
{required String productId}) → Future< void> -
购买产品
override
-
refreshPurchases(
) → Future< void> -
刷新购买交易信息
override
-
requestReview(
) → void -
请求应用内评价
override
-
restorePurchases(
) → Future< void> -
恢复购买
override
-
safeLog(
String message, {Object? error, StackTrace? stackTrace}) → void - 安全日志输出方法
-
setupMethodCallHandler(
) → void - 设置方法调用处理器
-
showManageSubscriptionsSheet(
) → Future< void> -
打开订阅管理页面
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited