Skip to content
This repository has been archived by the owner on Mar 12, 2022. It is now read-only.

Commit

Permalink
Upgrade android sdk version
Browse files Browse the repository at this point in the history
  • Loading branch information
bdlukaa committed Jul 27, 2021
1 parent 1144cff commit 6a1d290
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 30 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
@@ -1,6 +1,11 @@
Date format: DD/MM/YYYY

# [1.4.1] - [19/07/2021]
## [1.5.0] - (26/07/2021)

- Upgrade Android SDK to version 20.2.0
- Removed `onLeftApplication` event.

## [1.4.1] - [19/07/2021]

- **FIX** `RewardedAdEvent.earnedReward` never gets called on iOS ([#85](https://github.com/bdlukaa/native_admob_flutter/pull/85))

Expand Down
2 changes: 1 addition & 1 deletion android/build.gradle
Expand Up @@ -40,5 +40,5 @@ android {

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.google.android.gms:play-services-ads:19.8.0'
implementation 'com.google.android.gms:play-services-ads:20.2.0'
}
Expand Up @@ -28,7 +28,8 @@ class AppOpenAdController(

private fun showAdIfAvailable(fullScreenContentCallback: FullScreenContentCallback) {
if (!isShowingAd && isAdAvailable()) {
appOpenAd!!.show(context, fullScreenContentCallback)
appOpenAd!!.fullScreenContentCallback = fullScreenContentCallback
appOpenAd!!.show(context)
}
}

Expand All @@ -45,13 +46,13 @@ class AppOpenAdController(
val nonPersonalizedAds = call.argument<Boolean>("nonPersonalizedAds")!!
val keywords = call.argument<List<String>>("keywords")!!
AppOpenAd.load(context, unitId, RequestFactory.createAdRequest(nonPersonalizedAds, keywords), orientation, object : AppOpenAdLoadCallback() {
override fun onAppOpenAdLoaded(ad: AppOpenAd) {
override fun onAdLoaded(ad: AppOpenAd) {
appOpenAd = ad
channel.invokeMethod("onAppOpenAdLoaded", null)
result.success(true)
}

override fun onAppOpenAdFailedToLoad(loadAdError: LoadAdError) {
override fun onAdFailedToLoad(loadAdError: LoadAdError) {
channel.invokeMethod("onAppOpenAdFailedToLoad", encodeError(loadAdError))
result.success(false)
}
Expand Down
Expand Up @@ -51,11 +51,6 @@ class BannerAdView(context: Context, data: Map<String?, Any?>?) : PlatformView {
controller.channel.invokeMethod("onAdClicked", null)
}

override fun onAdLeftApplication() {
super.onAdClicked()
controller.channel.invokeMethod("onAdLeftApplication", null)
}

override fun onAdFailedToLoad(error: LoadAdError) {
super.onAdFailedToLoad(error)
controller.channel.invokeMethod("onAdFailedToLoad", encodeError(error))
Expand Down
Expand Up @@ -104,11 +104,6 @@ class NativeAdmobController(
}
.withAdListener(object : AdListener() {

override fun onAdLeftApplication() {
super.onAdClicked()
channel.invokeMethod("onAdLeftApplication", null)
}

override fun onAdFailedToLoad(error: LoadAdError) {
super.onAdFailedToLoad(error)
channel.invokeMethod("onAdFailedToLoad", encodeError(error))
Expand Down
Expand Up @@ -51,7 +51,7 @@ class RewardedAdController(
channel.invokeMethod("onAdLoaded", null)
result.success(true)
}
override fun onRewardedAdFailedToLoad(error: LoadAdError) {
override fun onAdFailedToLoad(error: LoadAdError) {
channel.invokeMethod("onAdFailedToLoad", encodeError(error))
result.success(false)
}
Expand Down
8 changes: 0 additions & 8 deletions lib/src/banner/controller.dart
Expand Up @@ -14,8 +14,6 @@ import '../utils.dart';
/// - loading (When the ad starts loading)
/// - loaded (When the ad is loaded)
/// - loadFailed (When the ad failed to load)
/// - leftApplication (When the user has left the app)
/// - undefined (When an unknown event arrives)
enum BannerAdEvent {
/// Called when an impression is recorded for an ad.
impression,
Expand All @@ -28,9 +26,6 @@ enum BannerAdEvent {

/// Called when the ad starts loading
loading,

/// Called when the user left the application
leftApplication,
}

/// The size of a [BannerAd]. It's highly recommended to use
Expand Down Expand Up @@ -214,9 +209,6 @@ class BannerAdController extends LoadShowAd<BannerAdEvent>
case 'onAdImpression':
onEventController.add({BannerAdEvent.impression: null});
break;
case 'onAdLeftApplication':
onEventController.add({BannerAdEvent.leftApplication: null});
break;
default:
break;
}
Expand Down
6 changes: 0 additions & 6 deletions lib/src/native/controller/controller.dart
Expand Up @@ -19,7 +19,6 @@ export 'options.dart';
/// - loadFailed (When the ad failed to load)
/// - muted (When the ad is dismissed)
/// - undefined (When it receives an unknown error)
/// - leftApplication (When the user leaves the app)
///
/// For more info, read the [documentation](https://github.com/bdlukaa/native_admob_flutter/wiki/Using-the-controller-and-listening-to-native-events#listen-to-events)
enum NativeAdEvent {
Expand Down Expand Up @@ -51,8 +50,6 @@ enum NativeAdEvent {
/// Called when the event is unkown (usually for rebuilding ui)
undefined,

/// Called when the user left the app
leftApplication,
}

/// The video events a [NativeAdController] can receive. Listen
Expand Down Expand Up @@ -364,9 +361,6 @@ class NativeAdController extends LoadShowAd<NativeAdEvent>
case 'onAdMuted':
onEventController.add({NativeAdEvent.muted: null});
break;
case 'onAdLeftApplication':
onEventController.add({NativeAdEvent.leftApplication: null});
break;
case 'undefined':
default:
onEventController.add({NativeAdEvent.undefined: null});
Expand Down

0 comments on commit 6a1d290

Please sign in to comment.