Adapty Flutter SDK'yı v. 3.8'e Geçirme

Adapty SDK 3.8.0, bazı iyileştirmeler getiren önemli bir sürümdür; ancak bu iyileştirmeler sizin tarafınızdan bazı geçiş adımları gerektirebilir.

  1. Observer sınıfı ve metod adlarını güncelleyin.
  2. Yedek paywall metod adını güncelleyin.
  3. Olay işleme metodlarındaki view sınıf adını güncelleyin.

Observer sınıfı ve metod adlarını güncelleme

Observer sınıfı ve kayıt metodu yeniden adlandırıldı:

- class MyObserver extends AdaptyUIObserver {
+ class MyObserver extends AdaptyUIPaywallsEventsObserver {
   @override
   void paywallViewDidPerformAction(AdaptyUIView view, AdaptyUIAction action) {
     // Handle action
   }
 }

 // Register observer
- AdaptyUI().setObserver(this);
+ AdaptyUI().setPaywallsEventsObserver(this);

Yedek paywall metod adını güncelleme

Yedek paywall ayarlama metodu basitleştirildi:

 try {
-  await Adapty.setFallbackPaywalls(assetId);
+  await Adapty.setFallback(assetId);
 } on AdaptyError catch (adaptyError) {
   // handle the error
 } catch (e) {
   // handle the error
 }

Olay işleme metodlarındaki view sınıf adını güncelleme

Tüm olay işleme metodları artık AdaptyUIView yerine yeni AdaptyUIPaywallView sınıfını kullanıyor:

- void paywallViewDidPerformAction(AdaptyUIView view, AdaptyUIAction action)
+ void paywallViewDidPerformAction(AdaptyUIPaywallView view, AdaptyUIAction action)

- void paywallViewDidSelectProduct(AdaptyUIView view, AdaptyPaywallProduct product)
+ void paywallViewDidSelectProduct(AdaptyUIPaywallView view, AdaptyPaywallProduct product)

- void paywallViewDidStartPurchase(AdaptyUIView view, AdaptyPaywallProduct product)
+ void paywallViewDidStartPurchase(AdaptyUIPaywallView view, AdaptyPaywallProduct product)

- void paywallViewDidFinishPurchase(AdaptyUIView view, AdaptyPaywallProduct product, AdaptyProfile profile)
+ void paywallViewDidFinishPurchase(AdaptyUIPaywallView view, AdaptyPaywallProduct product, AdaptyProfile profile)

- void paywallViewDidFailPurchase(AdaptyUIView view, AdaptyPaywallProduct product, AdaptyError error)
+ void paywallViewDidFailPurchase(AdaptyUIPaywallView view, AdaptyPaywallProduct product, AdaptyError error)

- void paywallViewDidFinishRestore(AdaptyUIView view, AdaptyProfile profile)
+ void paywallViewDidFinishRestore(AdaptyUIPaywallView view, AdaptyProfile profile)

- void paywallViewDidFailRestore(AdaptyUIView view, AdaptyError error)
+ void paywallViewDidFailRestore(AdaptyUIPaywallView view, AdaptyError error)

- void paywallViewDidFailLoadingProducts(AdaptyUIView view, AdaptyIOSProductsFetchPolicy? fetchPolicy, AdaptyError error)
+ void paywallViewDidFailLoadingProducts(AdaptyUIPaywallView view, AdaptyIOSProductsFetchPolicy? fetchPolicy, AdaptyError error)

- void paywallViewDidFailRendering(AdaptyUIView view, AdaptyError error)
+ void paywallViewDidFailRendering(AdaptyUIPaywallView view, AdaptyError error)