From 97cc525442a5ccae97c3fbd5ff16544297cab62d Mon Sep 17 00:00:00 2001 From: gstory Date: Wed, 29 May 2024 16:12:10 +0800 Subject: [PATCH] =?UTF-8?q?*=20=E4=BC=98=E5=8C=96=E5=B9=BF=E5=91=8A?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD=E5=A4=B1=E8=B4=A5=E5=9B=9E=E8=B0=83=20*=20?= =?UTF-8?q?=E5=8F=91=E5=B8=831.1.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 3 +++ ios/Classes/interstitial/SigmobInterstitialAd.m | 2 +- ios/Classes/native/SigmobAdNativeView.m | 3 +-- ios/Classes/reward/SigmobRewardAd.m | 2 +- ios/Classes/splash/SigmobAdSplashView.m | 6 ++---- lib/widget/sigmobad_native_widget.dart | 3 +-- lib/widget/sigmobad_splash_widget.dart | 3 +-- pubspec.yaml | 2 +- 8 files changed, 11 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 39849d2..2c2f036 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +## 1.1.1 +* 优化广告加载失败回调 + ## 1.1.0 * andorid升级4.17.1 * iOS升级4.13.0 diff --git a/ios/Classes/interstitial/SigmobInterstitialAd.m b/ios/Classes/interstitial/SigmobInterstitialAd.m index 50966ac..03da5d7 100644 --- a/ios/Classes/interstitial/SigmobInterstitialAd.m +++ b/ios/Classes/interstitial/SigmobInterstitialAd.m @@ -67,7 +67,7 @@ - (void)intersititialAdDidLoad:(WindNewIntersititialAd *)intersititialAd{ */ - (void)intersititialAdDidLoad:(WindNewIntersititialAd *)intersititialAd didFailWithError:(NSError *)error{ [[SigmobLogUtil sharedInstance] print:([NSString stringWithFormat:@"激励广告加载失败 %@",error.description])]; - NSDictionary *dictionary = @{@"adType":@"interstitialAd",@"onAdMethod":@"onFail",@"message":error.description}; + NSDictionary *dictionary = @{@"adType":@"interstitialAd",@"onAdMethod":@"onFail",@"message":[NSString stringWithFormat:@"%@",error]}; [[SigmobAdEvent sharedInstance] sentEvent:dictionary]; } diff --git a/ios/Classes/native/SigmobAdNativeView.m b/ios/Classes/native/SigmobAdNativeView.m index d57461c..a16f130 100644 --- a/ios/Classes/native/SigmobAdNativeView.m +++ b/ios/Classes/native/SigmobAdNativeView.m @@ -104,8 +104,7 @@ - (void)nativeAdsManagerSuccessToLoad:(WindNativeAdsManager *)adsManager nativeA //广告加载失败 - (void)nativeAdsManager:(WindNativeAdsManager *)adsManager didFailWithError:(NSError *)error{ [[SigmobLogUtil sharedInstance] print:([NSString stringWithFormat:@"信息流广告拉取失败 %@",error])]; - NSDictionary *dictionary = @{@"message":error.description}; - [_channel invokeMethod:@"onFail" arguments:dictionary result:nil]; + [_channel invokeMethod:@"onFail" arguments:[NSString stringWithFormat:@"%@",error] result:nil]; } #pragma mark - WindNativeAdViewDelegate diff --git a/ios/Classes/reward/SigmobRewardAd.m b/ios/Classes/reward/SigmobRewardAd.m index b54d443..5959393 100644 --- a/ios/Classes/reward/SigmobRewardAd.m +++ b/ios/Classes/reward/SigmobRewardAd.m @@ -85,7 +85,7 @@ - (void)rewardVideoAdDidLoad:(WindRewardVideoAd *)rewardVideoAd{ */ - (void)rewardVideoAdDidLoad:(WindRewardVideoAd *)rewardVideoAd didFailWithError:(NSError *)error{ [[SigmobLogUtil sharedInstance] print:([NSString stringWithFormat:@"激励广告加载失败 %@",error.description])]; - NSDictionary *dictionary = @{@"adType":@"rewardAd",@"onAdMethod":@"onFail",@"message":error.description}; + NSDictionary *dictionary = @{@"adType":@"rewardAd",@"onAdMethod":@"onFail",@"message":[NSString stringWithFormat:@"%@",error]}; [[SigmobAdEvent sharedInstance] sentEvent:dictionary]; } diff --git a/ios/Classes/splash/SigmobAdSplashView.m b/ios/Classes/splash/SigmobAdSplashView.m index a87eac5..f54f2ba 100644 --- a/ios/Classes/splash/SigmobAdSplashView.m +++ b/ios/Classes/splash/SigmobAdSplashView.m @@ -102,8 +102,7 @@ - (void)onSplashAdDidLoad:(WindSplashAdView *)splashAdView{ */ -(void)onSplashAdLoadFail:(WindSplashAdView *)splashAdView error:(NSError *)error{ [[SigmobLogUtil sharedInstance] print:([NSString stringWithFormat:@"开屏广告加载失败 %@",error])]; - NSDictionary *dictionary = @{@"message":error.description}; - [_channel invokeMethod:@"onFail" arguments:dictionary result:nil]; + [_channel invokeMethod:@"onFail" arguments:[NSString stringWithFormat:@"%@",error] result:nil]; } /** @@ -119,8 +118,7 @@ -(void)onSplashAdSuccessPresentScreen:(WindSplashAdView *)splashAdView{ */ -(void)onSplashAdFailToPresent:(WindSplashAdView *)splashAdView withError:(NSError *)error{ [[SigmobLogUtil sharedInstance] print:([NSString stringWithFormat:@"开屏广告展示失败 %@",error])]; - NSDictionary *dictionary = @{@"message":error.description}; - [_channel invokeMethod:@"onFail" arguments:dictionary result:nil]; + [_channel invokeMethod:@"onFail" arguments:[NSString stringWithFormat:@"%@",error] result:nil]; } diff --git a/lib/widget/sigmobad_native_widget.dart b/lib/widget/sigmobad_native_widget.dart index f1212ee..6dabc92 100644 --- a/lib/widget/sigmobad_native_widget.dart +++ b/lib/widget/sigmobad_native_widget.dart @@ -114,8 +114,7 @@ class _KSAdNativeWidgetState extends State { break; //广告加载失败 case SigmobAdMethod.onFail: - Map map = call.arguments; - widget.callBack?.onFail!(map["message"]); + widget.callBack?.onFail!(call.arguments); if (mounted) { setState(() { _isShowAd = false; diff --git a/lib/widget/sigmobad_splash_widget.dart b/lib/widget/sigmobad_splash_widget.dart index 509a85b..ae3c79a 100644 --- a/lib/widget/sigmobad_splash_widget.dart +++ b/lib/widget/sigmobad_splash_widget.dart @@ -110,8 +110,7 @@ class _SigmobAdSplashWidgetState extends State { //广告加载失败 case SigmobAdMethod.onFail: if (widget.callBack?.onFail != null) { - Map map = call.arguments; - widget.callBack?.onFail!(map["message"]); + widget.callBack?.onFail!(call.arguments); } if (mounted) { setState(() { diff --git a/pubspec.yaml b/pubspec.yaml index 2cc0adc..65c1b3f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: sigmobad description: Sigmob广告flutter版 -version: 1.1.0 +version: 1.1.1 homepage: https://github.com/gstory0404/sigmobad environment: