Skip to content

Commit e25584d

Browse files
malandr2copybara-github
authored andcommitted
Adding includecode to Initializing the SDK
PiperOrigin-RevId: 770160052
1 parent 13b0654 commit e25584d

File tree

5 files changed

+10
-0
lines changed

5 files changed

+10
-0
lines changed

Objective-C/admanager/AdManagerBannerExample/AdManagerBannerExample/ViewController.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,10 @@ - (void)viewWillTransitionToSize:(CGSize)size
128128
- (void)startGoogleMobileAdsSDK {
129129
static dispatch_once_t onceToken;
130130
dispatch_once(&onceToken, ^{
131+
// [START initialize_sdk]
131132
// Initialize the Google Mobile Ads SDK.
132133
[GADMobileAds.sharedInstance startWithCompletionHandler:nil];
134+
// [END initialize_sdk]
133135
[self loadBannerAd];
134136
});
135137
}

Objective-C/admob/BannerExample/BannerExample/ViewController.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,10 @@ - (void)viewWillTransitionToSize:(CGSize)size
128128
- (void)startGoogleMobileAdsSDK {
129129
static dispatch_once_t onceToken;
130130
dispatch_once(&onceToken, ^{
131+
// [START initialize_sdk]
131132
// Initialize the Google Mobile Ads SDK.
132133
[GADMobileAds.sharedInstance startWithCompletionHandler:nil];
134+
// [END initialize_sdk]
133135
[self loadBannerAd];
134136
});
135137
}

Swift/admanager/AdManagerBannerExample/AdManagerBannerExample/ViewController.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,10 @@ class ViewController: UIViewController, BannerViewDelegate {
7272

7373
self.isMobileAdsStartCalled = true
7474

75+
// [START initialize_sdk]
7576
// Initialize the Google Mobile Ads SDK.
7677
MobileAds.shared.start()
78+
// [END initialize_sdk]
7779

7880
self.loadBannerAd()
7981
}

Swift/admob/BannerExample/BannerExample/ViewController.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,10 @@ class ViewController: UIViewController, BannerViewDelegate {
102102

103103
self.isMobileAdsStartCalled = true
104104

105+
// [START initialize_sdk]
105106
// Initialize the Google Mobile Ads SDK.
106107
MobileAds.shared.start()
108+
// [END initialize_sdk]
107109

108110
self.loadBannerAd()
109111
}

Swift/advanced/SwiftUIDemo/SwiftUIDemo/Supporting-Files/GoogleMobileAdsConsentManager.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ class GoogleMobileAdsConsentManager: NSObject {
8484

8585
isMobileAdsStartCalled = true
8686

87+
// [START initialize_sdk]
8788
// Initialize the Google Mobile Ads SDK.
8889
MobileAds.shared.start()
90+
// [END initialize_sdk]
8991
}
9092
}

0 commit comments

Comments
 (0)