我通过以下视频制作了测试应用程序: https ://www.youtube.com/watch?v=h-jOMh2KXTA
我的 ButtonBar 的 onPressed 事件:
onPressed: fetchOffers
当我按下按钮时没有任何反应,我希望它打开谷歌的支付屏幕
fetchOffers code:
Future fetchOffers() async {
final offerings = await PurchaseApi.fetchOffers();
final offer = offerings.first;
print('Teklifler: $offer');
final packages = offerings
.map((offer) => offer.availablePackages)
.expand((pair) => pair)
.toList();
(context) => PaywallWidget(
packages: packages,
title: 'Become a tester',
description: 'tester',
onClickedPackage: (package) async {
await PurchaseApi.purchasePackage(package);
Navigator.pop(context);
},
);
}
我的日志:
Restarted application in 2.247ms.
I/FLTFireMsgService(25149): FlutterFirebaseMessagingBackgroundService started!
W/System (25149): Ignoring header X-Firebase-Locale because its value was null.
W/DynamiteModule(25149): Local module descriptor class for com.google.android.gms.providerinstaller.dynamite not found.
I/DynamiteModule(25149): Considering local module com.google.android.gms.providerinstaller.dynamite:0 and remote module com.google.android.gms.providerinstaller.dynamite:0
W/ProviderInstaller(25149): Failed to load providerinstaller module: No acceptable module found. Local version is 0 and remote version is 0.
D/FirebaseAuth(25149): Notifying id token listeners about user ( VIOSm4ivPNPF7JatnAl5CZMN2uI2 ).
V/NativeCrypto(25149): Registering com/google/android/gms/org/conscrypt/NativeCrypto's 294 native methods...
W/kingmoon.iohac(25149): Accessing hidden method Ljava/security/spec/ECParameterSpec;->getCurveName()Ljava/lang/String; (light greylist, reflection)
I/ProviderInstaller(25149): Installed default security provider GmsCore_OpenSSL
W/FLTFireMsgService(25149): Attempted to start a duplicate background isolate. Returning...
D/[Purchases] - DEBUG(25149): ℹ️ Debug logging enabled
D/[Purchases] - DEBUG(25149): ℹ️ SDK Version - 4.3.0
D/[Purchases] - DEBUG(25149): Initial App User ID - null
D/[Purchases] - DEBUG(25149): Identifying App User ID: $RCAnonymousID:e0abdc88ab164a6ab2e3e48e8924aa37
D/[Purchases] - DEBUG(25149): ℹ️ Deleting old synced subscriber attributes that don't belong to $RCAnonymousID:e0abdc88ab164a6ab2e3e48e8924aa37
D/[Purchases] - DEBUG(25149): ℹ️ App foregrounded
D/[Purchases] - DEBUG(25149): ℹ️ PurchaserInfo cache is stale, updating from network in foreground.
D/[Purchases] - DEBUG(25149): ℹ️ Offerings cache is stale, updating from network in foreground
D/[Purchases] - DEBUG(25149): Offerings updated from network.
D/[Purchases] - DEBUG(25149): ℹ️ Skipping updating pending purchase queue since BillingClient is not connected yet.
D/[Purchases] - DEBUG(25149): ℹ️ No subscriber attributes to synchronize.
D/[Purchases] - DEBUG(25149): ℹ️ Listener set
D/[Purchases] - DEBUG(25149): ℹ️ Sending latest PurchaserInfo to listener.
D/[Purchases] - DEBUG(25149): ℹ️ Starting connection for com.android.billingclient.api.BillingClientImpl@5895615
D/[Purchases] - DEBUG(25149): ℹ️ Ending connection for com.android.billingclient.api.BillingClientImpl@d9ddf30
W/kingmoon.iohac(25149): Accessing hidden field Ljava/net/Socket;->impl:Ljava/net/SocketImpl; (light greylist, reflection)
W/kingmoon.iohac(25149): Accessing hidden method Ldalvik/system/CloseGuard;->get()Ldalvik/system/CloseGuard; (light greylist, linking)
W/kingmoon.iohac(25149): Accessing hidden method Ldalvik/system/CloseGuard;->open(Ljava/lang/String;)V (light greylist, linking)
D/[Purchases] - DEBUG(25149): ℹ️ Billing Service Setup finished for com.android.billingclient.api.BillingClientImpl@5895615
D/[Purchases] - DEBUG(25149): ℹ️ Updating pending purchase queue
W/kingmoon.iohac(25149): Accessing hidden method Ldalvik/system/BlockGuard;->getThreadPolicy()Ldalvik/system/BlockGuard$Policy; (light greylist, linking)
W/kingmoon.iohac(25149): Accessing hidden method Ldalvik/system/BlockGuard$Policy;->onNetwork()V (light greylist, linking)
D/[Purchases] - DEBUG(25149): ℹ️ API request started: GET /subscribers/%24RCAnonymousID%3Ae0abdc88ab164a6ab2e3e48e8924aa37
D/[Purchases] - DEBUG(25149): ℹ️ API request completed with status: GET /subscribers/%24RCAnonymousID%3Ae0abdc88ab164a6ab2e3e48e8924aa37 304
D/[Purchases] - DEBUG(25149): ℹ️ PurchaserInfo updated, sending to listener.
D/[Purchases] - DEBUG(25149): ℹ️ API request started: GET /subscribers/%24RCAnonymousID%3Ae0abdc88ab164a6ab2e3e48e8924aa37/offerings
D/[Purchases] - DEBUG(25149): ℹ️ API request completed with status: GET /subscribers/%24RCAnonymousID%3Ae0abdc88ab164a6ab2e3e48e8924aa37/offerings 304
D/[Purchases] - DEBUG(25149): ℹ️ Requesting products from the store with identifiers: goldabone
D/[Purchases] - DEBUG(25149): ℹ️ Querying purchases
D/[Purchases] - DEBUG(25149): ℹ️ Cleaning previously sent tokens
D/[Purchases] - DEBUG(25149): ℹ️ Tokens already posted: []
D/[Purchases] - DEBUG(25149): ℹ️ Saving tokens []
D/[Purchases] - DEBUG(25149): ℹ️ Tokens already posted: []
D/[Purchases] - DEBUG(25149): ℹ️ Products request finished for goldabone
D/[Purchases] - DEBUG(25149): Retrieved skuDetailsList: SkuDetails: {"productId":"goldabone","type":"subs","title":"Gold Abone (TestApp)","name":"Gold Abone","price":"TRY 2.39","price_amount_micros":2390000,"price_currency_code":"TRY","description":"test","subscriptionPeriod":"P1M","skuDetailsToken":"AEuhp4IxGLm0l5_zq4DhuHTaWv3vkY7vTDUtsHXTBCr9Wnt6IRP2NjzJXkAZkWSRmbyh"}
D/[Purchases] - DEBUG(25149): goldabone - SkuDetails: {"productId":"goldabone","type":"subs","title":"Gold Abone (TestApp)","name":"Gold Abone","price":"TRY 2.39","price_amount_micros":2390000,"price_currency_code":"TRY","description":"test","subscriptionPeriod":"P1M","skuDetailsToken":"AEuhp4IxGLm0l5_zq4DhuHTaWv3vkY7vTDUtsHXTBCr9Wnt6IRP2NjzJXkAZkWSRmbyh"}
D/DynamitePackage(25149): Instantiating com.google.android.gms.ads.ChimeraAdManagerCreatorImpl
我的按钮的 onPress 事件日志
D/[Purchases] - DEBUG(25149): ℹ️ Vending Offerings from cache
D/[Purchases] - DEBUG(25149): ℹ️ Checking if cache is stale AppInBackground false
D/[Purchases] - DEBUG(25149): ℹ️ Offerings cache is stale, updating from network in foreground
D/[Purchases] - DEBUG(25149): Offerings updated from network.
I/flutter (25149): Teklifler: Offering{identifier: subscriptions, serverDescription: Standard set of subscription, availablePackages: [Package{identifier: $rc_monthly, packageType: PackageType.monthly, product: Product{identifier: goldabone, description: test, title: Gold Abone (TestAPP), price: 2.39, priceString: TRY 2.39, currencyCode: TRY, introductoryPrice: null}, offeringIdentifier: subscriptions}], lifetime: null, annual: null, sixMonth: null, threeMonth: null, twoMonth: null, monthly: Package{identifier: $rc_monthly, packageType: PackageType.monthly, product: Product{identifier: goldabone, description: test, title: Gold Abone (TestAPP), price: 2.39, priceString: TRY 2.39, currencyCode: TRY, introductoryPrice: null}, offeringIdentifier: subscriptions}, weekly: null}
D/[Purchases] - DEBUG(25149): ℹ️ API request started: GET /subscribers/%24RCAnonymousID%3Ae0abdc88ab164a6ab2e3e48e8924aa37/offerings
D/[Purchases] - DEBUG(25149): ℹ️ API request completed with status: GET /subscribers/%24RCAnonymousID%3Ae0abdc88ab164a6ab2e3e48e8924aa37/offerings 304
D/[Purchases] - DEBUG(25149): ℹ️ Requesting products from the store with identifiers: goldabone
D/[Purchases] - DEBUG(25149): ℹ️ Products request finished for goldabone
D/[Purchases] - DEBUG(25149): Retrieved skuDetailsList: SkuDetails: {"productId":"goldabone","type":"subs","title":"Gold Abone (TestAPP)","name":"Gold Abone","price":"TRY 2.39","price_amount_micros":2390000,"price_currency_code":"TRY","description":"test","subscriptionPeriod":"P1M","skuDetailsToken":"AEuhp4IxGLm0l5_zq4DhuHTaWv3vkY7vTDUtsHXTBCr9Wnt6IRP2NjzJXkAZkWSRmbyh"}
D/[Purchases] - DEBUG(25149): goldabone - SkuDetails: {"productId":"goldabone","type":"subs","title":"Gold Abone (TestAPP)","name":"Gold Abone","price":"TRY 2.39","price_amount_micros":2390000,"price_currency_code":"TRY","description":"test","subscriptionPeriod":"P1M","skuDetailsToken":"AEuhp4IxGLm0l5_zq4DhuHTaWv3vkY7vTDUtsHXTBCr9Wnt6IRP2NjzJXkAZkWSRmbyh"}
感谢所有帮助过每个人的美丽的人。♥♥♥</p>