Skip to content

Commit

Permalink
Update samples to be stable for version 11.0.0 release
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 596143741
  • Loading branch information
Justin Malandruccolo authored and maddevrelgithubbot committed Jan 12, 2024
1 parent e90eccb commit b094a24
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ - (IBAction)loadTargetedAd:(id)sender {
GADRequest *request = [GADRequest request];
if ([self.childDirectedLabel.text isEqual:@"Yes"] ||
[self.childDirectedLabel.text isEqual:@"No"]) {
[GADMobileAds.sharedInstance.requestConfiguration
tagForChildDirectedTreatment:self.childDirectedLabel.text.boolValue];
GADMobileAds.sharedInstance.requestConfiguration.tagForChildDirectedTreatment =
[NSNumber numberWithBool:self.childDirectedLabel.text.boolValue];
}

[self.bannerView loadRequest:request];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ @implementation AdMobNativeCustomMuteThisAdViewController

- (void)viewDidLoad {
[super viewDidLoad];
self.versionLabel.text = GADMobileAds.sharedInstance.sdkVersion;
self.versionLabel.text = GADGetStringFromVersionNumber(GADMobileAds.sharedInstance.versionNumber);

NSArray<GADNativeAdView *> *nibObjects = [[NSBundle mainBundle] loadNibNamed:@"NativeAdView"
owner:nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ @implementation GAMCustomVideoControlsController
- (void)viewDidLoad {
[super viewDidLoad];

self.versionLabel.text = GADMobileAds.sharedInstance.sdkVersion;
self.versionLabel.text = GADGetStringFromVersionNumber(GADMobileAds.sharedInstance.versionNumber);
[self refreshAd:nil];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ class AppOpenAdManager: NSObject {
print("Start loading app open ad.")
GADAppOpenAd.load(
withAdUnitID: "/6499/example/app-open",
request: GADRequest(),
orientation: UIInterfaceOrientation.portrait
request: GADRequest()
) { ad, error in
self.isLoadingAd = false
if let error = error {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ class AppOpenAdManager: NSObject {
print("Start loading app open ad.")
GADAppOpenAd.load(
withAdUnitID: "ca-app-pub-3940256099942544/5575463023",
request: GADRequest(),
orientation: UIInterfaceOrientation.portrait
request: GADRequest()
) { ad, error in
self.isLoadingAd = false
if let error = error {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class AdManagerMultipleAdSizesViewController: UIViewController, GADAdSizeDelegat
view.addConstraint(
NSLayoutConstraint(
item: bannerView!, attribute: .bottom, relatedBy: .equal,
toItem: bottomLayoutGuide, attribute: .top, multiplier: 1, constant: 0))
toItem: view.safeAreaLayoutGuide.bottomAnchor, attribute: .top, multiplier: 1, constant: 0))
view.addConstraint(
NSLayoutConstraint(
item: bannerView!, attribute: .centerX, relatedBy: .equal,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,9 @@ class AdMobAdTargetingTableViewController: UITableViewController, UIPickerViewDa
@IBAction func loadTargetedAd(_ sender: AnyObject) {
let request = GADRequest()
if childDirectedLabel.text == "Yes" {
GADMobileAds.sharedInstance().requestConfiguration.tag(forChildDirectedTreatment: true)
GADMobileAds.sharedInstance().requestConfiguration.tagForChildDirectedTreatment = true
} else if childDirectedLabel.text == "No" {
GADMobileAds.sharedInstance().requestConfiguration.tag(forChildDirectedTreatment: false)
GADMobileAds.sharedInstance().requestConfiguration.tagForChildDirectedTreatment = false
}
bannerView.load(request)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ class AdMobBannerSizesViewController: UIViewController, UIPickerViewDataSource,
view.addConstraint(
NSLayoutConstraint(
item: bannerView!, attribute: .bottom, relatedBy: .equal,
toItem: bottomLayoutGuide, attribute: .top, multiplier: 1, constant: 0))
toItem: view.safeAreaLayoutGuide.bottomAnchor, attribute: .top, multiplier: 1, constant: 0
))
view.addConstraint(
NSLayoutConstraint(
item: bannerView!, attribute: .centerX, relatedBy: .equal,
Expand Down

0 comments on commit b094a24

Please sign in to comment.