bdlukaa/native_admob_flutter

[iOS] [NativeAd] Strange refresh behaviors in some situations after 1 minute

開放

#73 建立於 2021年6月7日

 (3 則留言) (0 個反應) (0 位負責人)Dart (57 個分叉)github user discovery
Native Adhelp wantediOS

倉庫指標

星標
 (81 顆星)
PR 合併指標
 (30 天內沒有已合併 PR)

描述

In the example app if we add TickerProviderStateMixin to the class where NativeAds are placed, the ad to which a NativeAdController is attached will refresh to "error" after almost 1 minute, especially if we go back and forth to the second page of NativeAds.

Another situation which will cause such behavior is when we remove the ListView, put only 1 NativeAd with controller in the page, and do not check if (controller.isLoaded) . The NativeAd will appear as soon as it's loaded, then after 1 minute it will refresh to "error" (the parent widget should have to rebuild itself for seeing this effect, like switching tabs in IndexedStack with BottomNavigationBar).

These don't happen in Android at all. And currently, I've tested it only in iOS Simulator. Soon I'll check it in a real iOS device.

As you can see in the screenshots below, the first ad which had a controller attached to it is disappeared (after tapping the top right arrow to go to the next page and coming back. This will not happen if we do it when less than 1 minute is passed after the ad is loaded for the first time.

Simulator Screen Shot - iPhone 12 Pro Max - 2021-06-07 at 15 30 51

And now the first ad is disappeared (because controller.isLoaded is switched to false ! )

Simulator Screen Shot - iPhone 12 Pro Max - 2021-06-07 at 15 32 51

貢獻者指南