0

这是我的 pubspec.yaml 文件中的包。

cloud_firestore: ^2.5.3
firebase_core_web: ^1.1.0
cloud_firestore_web: ^2.4.3
firebase_core: ^1.7.0
firebase_auth: ^3.1.2
provider: ^6.0.1
firebase_messaging: ^10.0.8
firebase_crashlytics: ^2.2.2
firebase_analytics: ^8.3.3
purchases_flutter: ^3.0.0

我在 Flutter 稳定通道版本 2.5.2 中运行所有内容。我也尝试使用颤振通道测试版 2.6.0-5.2.pre。

手机的iOS版本是15.0.1。我在 Iphone 7(物理设备,而不是模拟器)上运行测试。XCode 版本为 13.0。MAC OS 是 Big Sur 11.6(带 M1 芯片)。

该应用程序在 Android 上运行良好,但当我调用以下函数时,它会在应用程序启动时挂起:

Offerings rcOfferings;
rcOfferings = await Purchases.getOfferings();

而且该getOfferings()功能永远不会返回..它之前工作得非常好..

在更新过程中,我所做的唯一更改如下:删除以下内容: Purchases.identify(rcAppUserId); 改为使用: Purchases.logIn(rcAppUserId);

这是一个已知的问题?getOfferings() 函数从不返回任何东西的潜在原因是什么……?当这个函数被调用并且应用程序永远不会启动时它会挂起......</p>


附录

我启用了日志,这是我看到的:

[Purchases] - DEBUG: ℹ️ Debug logging enabled
[Purchases] - DEBUG: ℹ️ SDK Version - 3.12.3
[Purchases] - DEBUG:  Initial App User ID - (null)
[Purchases] - DEBUG: ℹ️ Sending latest PurchaserInfo to delegate.
[Purchases] - DEBUG: ℹ️ Delegate set
[Purchases] - DEBUG: ℹ️ There are no requests currently running, starting request GET /subscribers/1634905166007
[Purchases] - DEBUG: ℹ️ API request started: GET /v1/subscribers/1634905166
[Purchases] - DEBUG: ℹ️ API request started: GET /v1/subscribers/1634905166/offerings
[Purchases] - DEBUG: ℹ️ API request completed with status: GET /v1/subscribers/1634905166/offerings 304

[Purchases] - DEBUG: ℹ️ Requesting products from the store with identifiers: {(
    "product_1",
    "product_2",
    "product_3",
    "product_4",
    "product_5",
    "product_6"
)}
[Purchases] - DEBUG: ℹ️ API request completed with status: GET /v1/subscribers/1634905166007 304
[Purchases] - DEBUG: ℹ️ Serial request done: GET /subscribers/1634905166007, 0 requests left in the queue
flutter:
Init Platform State RevenueCat - DONE!
flutter:
Get offerings - RevenueCat
[tcp] tcp_output [C4.1:3] flags=[R.] seq=2740821213, ack=1928912997, win=4095 state=CLOSED rcv_nxt=1928912997, snd_una=2740821136
[BackgroundTask] Background Task 12 ("SKProductsRequest"), was created over 30 seconds ago. In applications running in the background, this creates a risk of termination. Remember to call UIApplication.endBackgroundTask(_:) for your task in a timely manner to avoid this.
flutter:
CALLING RevenueCat getRcOfferings() function now...
[Purchases] - DEBUG: ℹ️ No cached Offerings, fetching from network
[Purchases] - DEBUG: ℹ️ API request started: GET /v1/subscribers/1634905166/offerings
[Purchases] - DEBUG: ℹ️ API request completed with status: GET /v1/subscribers/1634905166/offerings 304
[tcp] tcp_output [C5.1:3] flags=[R.] seq=2802284821, ack=658575777, win=4103 state=CLOSED rcv_nxt=658575777, snd_una=2802284744

如上所示,它在一开始就列出了产品(我不太明白它是在哪个步骤中做到的)。

“CALLING RevenueCat getRcOfferings() function now...”这一行是调用 getOfferings() 函数的地方,应用程序在等待时挂起……当我说挂起时,它一直在等待这个异步调用完成。

希望这些额外的信息将有助于获得一些帮助......

4

1 回答 1

0

有一些人遇到这种情况的报告,比如这里: 

https://community.revenuecat.com/sdks-51/ios-15-xcode-13-rcpurchases-sharedpurchases-offeringswithcompletionblock-is-never-called-492

SKProductsRequest由于 StoreKit刚刚挂起,旧沙盒帐户似乎正在发生这种情况。RevenueCat 团队目前正在研究它以提出解决方案。

与此同时,据报道,创建一个新的沙盒用户对其他 RevenueCat 用户来说效果很好。

你能试一试吗?

于 2021-10-08T14:19:46.053 回答