将 Adapty iOS SDK 迁移到 v. 3.15

如果您在观察者模式下使用付费墙编辑工具,从 iOS SDK 3.15 开始,您需要实现一个新方法 observerModeDidInitiateRestorePurchases(onStartRestore:onFinishRestore:)。该方法提供了对恢复逻辑更精细的控制,允许您在自定义流程中处理恢复购买操作。有关完整的实现详情,请参阅在观察者模式下展示付费墙编辑工具付费墙

func observerMode(didInitiatePurchase product: AdaptyPaywallProduct,
                 onStartPurchase: @escaping () -> Void,
                 onFinishPurchase: @escaping () -> Void) {
      // use the product object to handle the purchase
      // use the onStartPurchase and onFinishPurchase callbacks to notify AdaptyUI about the process of the purchase
}

+ func observerModeDidInitiateRestorePurchases(onStartRestore: @escaping () -> Void,
+                                            onFinishRestore: @escaping () -> Void) {
+      // use the onStartRestore and onFinishRestore callbacks to notify AdaptyUI about the process of the restore
+ }