Skip to content

Commit

Permalink
Fix warnings and update versions (#694)
Browse files Browse the repository at this point in the history
* Fix java warnings and update GMA Android to 21.3.0 and iOS to 9.13
  • Loading branch information
jjliu15 authored Nov 15, 2022
1 parent 16dc8c5 commit fa15ddc
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 7 deletions.
5 changes: 5 additions & 0 deletions packages/google_mobile_ads/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 2.3.0
* Updates GMA iOS dependency to 9.13
* Updates GMA Android dependency to 21.3.0
* Updates request agent string based on metadata in AndroidManifest.xml or Info.plist

## 2.2.0
* Updates GMA iOS dependency to 9.11.0. This fixes dependency issues in apps that
also depend on the latest version of Firebase: https://github.com/googleads/googleads-mobile-flutter/issues/673
Expand Down
3 changes: 2 additions & 1 deletion packages/google_mobile_ads/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ android {
disable 'InvalidPackage'
}
dependencies {
api 'com.google.android.gms:play-services-ads:21.2.0'
api 'com.google.android.gms:play-services-ads:21.3.0'
implementation 'androidx.lifecycle:lifecycle-process:2.2.0'
implementation 'com.google.errorprone:error_prone_annotations:2.16'
testImplementation 'junit:junit:4.12'
testImplementation 'org.hamcrest:hamcrest:2.2'
testImplementation 'org.mockito:mockito-inline:3.9.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
/** Constants used in the plugin. */
public class Constants {
/** Version request agent. Should be bumped alongside plugin versions. */
public static final String REQUEST_AGENT_PREFIX_VERSIONED = "Flutter-GMA-2.2.0";
public static final String REQUEST_AGENT_PREFIX_VERSIONED = "Flutter-GMA-2.3.0";
/** Prefix for news template */
public static final String REQUEST_AGENT_NEWS_TEMPLATE_PREFIX = "News";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import com.google.android.gms.ads.admanager.AdManagerAdRequest;
import com.google.errorprone.annotations.CanIgnoreReturnValue;
import java.util.List;
import java.util.Map;
import java.util.Objects;
Expand All @@ -37,22 +38,26 @@ static class Builder extends FlutterAdRequest.Builder {
@Nullable private Map<String, List<String>> customTargetingLists;
@Nullable private String publisherProvidedId;

@CanIgnoreReturnValue
public Builder setCustomTargeting(@Nullable Map<String, String> customTargeting) {
this.customTargeting = customTargeting;
return this;
}

@CanIgnoreReturnValue
public Builder setCustomTargetingLists(
@Nullable Map<String, List<String>> customTargetingLists) {
this.customTargetingLists = customTargetingLists;
return this;
}

@CanIgnoreReturnValue
public Builder setPublisherProvidedId(@Nullable String publisherProvidedId) {
this.publisherProvidedId = publisherProvidedId;
return this;
}

@Override
FlutterAdManagerAdRequest build() {
return new FlutterAdManagerAdRequest(
getKeywords(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import com.google.ads.mediation.admob.AdMobAdapter;
import com.google.android.gms.ads.AdRequest;
import com.google.android.gms.ads.mediation.MediationExtrasReceiver;
import com.google.errorprone.annotations.CanIgnoreReturnValue;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -48,47 +49,56 @@ protected static class Builder {
@Nullable private Map<String, String> adMobExtras;
@NonNull private String requestAgent;

@CanIgnoreReturnValue
Builder setRequestAgent(String requestAgent) {
this.requestAgent = requestAgent;
return this;
}

@CanIgnoreReturnValue
Builder setKeywords(@Nullable List<String> keywords) {
this.keywords = keywords;
return this;
}

@CanIgnoreReturnValue
Builder setContentUrl(@Nullable String contentUrl) {
this.contentUrl = contentUrl;
return this;
}

@CanIgnoreReturnValue
Builder setNonPersonalizedAds(@Nullable Boolean nonPersonalizedAds) {
this.nonPersonalizedAds = nonPersonalizedAds;
return this;
}

@CanIgnoreReturnValue
Builder setNeighboringContentUrls(@Nullable List<String> neighboringContentUrls) {
this.neighboringContentUrls = neighboringContentUrls;
return this;
}

@CanIgnoreReturnValue
Builder setHttpTimeoutMillis(@Nullable Integer httpTimeoutMillis) {
this.httpTimeoutMillis = httpTimeoutMillis;
return this;
}

@CanIgnoreReturnValue
Builder setMediationNetworkExtrasIdentifier(@Nullable String mediationExtrasIdentifier) {
this.mediationExtrasIdentifier = mediationExtrasIdentifier;
return this;
}

@CanIgnoreReturnValue
Builder setMediationNetworkExtrasProvider(
@Nullable MediationNetworkExtrasProvider mediationNetworkExtrasProvider) {
this.mediationNetworkExtrasProvider = mediationNetworkExtrasProvider;
return this;
}

@CanIgnoreReturnValue
Builder setAdMobExtras(@Nullable Map<String, String> adMobExtras) {
this.adMobExtras = adMobExtras;
return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@ class FlutterRequestAgentProvider {
static final String NEWS_VERSION_KEY =
"io.flutter.plugins.googlemobileads.FLUTTER_NEWS_TEMPLATE_VERSION";

private final Context context;
@Nullable private String newsTemplateVersion;
@Nullable private String gameTemplateVersion;

FlutterRequestAgentProvider(Context context) {
this.context = context;
processGameAndNewsTemplateVersions(context);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/google_mobile_ads/ios/Classes/FLTConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
// limitations under the License.

/** Versioned request agent string. */
#define FLT_REQUEST_AGENT_VERSIONED @"Flutter-GMA-2.2.0"
#define FLT_REQUEST_AGENT_VERSIONED @"Flutter-GMA-2.3.0"
2 changes: 1 addition & 1 deletion packages/google_mobile_ads/ios/google_mobile_ads.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Google Mobile Ads plugin for Flutter.
s.source_files = 'Classes/**/*'
s.public_header_files = 'Classes/**/*.h'
s.dependency 'Flutter'
s.dependency 'Google-Mobile-Ads-SDK','~> 9.11'
s.dependency 'Google-Mobile-Ads-SDK','~> 9.13'
s.ios.deployment_target = '10.0'
s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'VALID_ARCHS' => 'armv7 arm64 x86_64' }
s.static_framework = true
Expand Down
2 changes: 1 addition & 1 deletion packages/google_mobile_ads/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

name: google_mobile_ads
version: 2.2.0
version: 2.3.0
description: Flutter plugin for Google Mobile Ads, supporting
banner, interstitial (full-screen), rewarded and native ads
repository: https://github.com/googleads/googleads-mobile-flutter/tree/main/packages/google_mobile_ads
Expand Down

0 comments on commit fa15ddc

Please sign in to comment.