diff --git a/android/build.gradle b/android/build.gradle index be3a589..b43e341 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -38,6 +38,6 @@ dependencies { implementation 'androidx.constraintlayout:constraintlayout:2.1.4' implementation 'androidx.legacy:legacy-support-v4:1.0.0' // 广告 SDK - implementation 'com.pangle.cn:ads-sdk-pro:5.8.1.3' + implementation 'com.pangle.cn:ads-sdk-pro:6.1.0.7' // compileOnly fileTree(dir: 'libs', include: ['*.jar', '*.aar']) } diff --git a/android/src/main/java/com/zero/flutter_pangle_ads/PluginDelegate.java b/android/src/main/java/com/zero/flutter_pangle_ads/PluginDelegate.java index c6c491c..be3c1f7 100644 --- a/android/src/main/java/com/zero/flutter_pangle_ads/PluginDelegate.java +++ b/android/src/main/java/com/zero/flutter_pangle_ads/PluginDelegate.java @@ -185,29 +185,7 @@ public void initAd(MethodCall call, final MethodChannel.Result result) { .directDownloadNetworkType(directDownloadNetworkTypeList)// 直接下载的网络方式 .build(); // 初始化 SDK - TTAdSdk.init(activity.getApplicationContext(), config, new TTAdSdk.InitCallback() { - @Override - public void success() { - activity.runOnUiThread(new Runnable() { - @Override - public void run() { - result.success(true); - } - }); - } - - @Override - public void fail(int code, String msg) { - Log.e(TAG, "fail: code = " + code + " msg = " + msg); - activity.runOnUiThread(new Runnable() { - @Override - public void run() { - result.success(false); - } - }); - - } - }); + TTAdSdk.init(activity.getApplicationContext(), config); } /** diff --git a/android/src/main/java/com/zero/flutter_pangle_ads/page/AdSplashActivity.java b/android/src/main/java/com/zero/flutter_pangle_ads/page/AdSplashActivity.java index 7e5c861..695814e 100644 --- a/android/src/main/java/com/zero/flutter_pangle_ads/page/AdSplashActivity.java +++ b/android/src/main/java/com/zero/flutter_pangle_ads/page/AdSplashActivity.java @@ -131,7 +131,7 @@ private int getMipmapId(String resName) { } @Override - public void onSplashLoadSuccess() { + public void onSplashLoadSuccess(CSJSplashAd csjSplashAd) { Log.d(TAG, "onSplashLoadSuccess"); // 加载事件 AdEventHandler.getInstance().sendEvent(new AdEvent(this.posId, AdEventAction.onAdLoaded));