Skip to content

Commit

Permalink
Publishing latest changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Tristan Emrich committed Nov 10, 2015
1 parent 8799c07 commit b246dd3
Show file tree
Hide file tree
Showing 32 changed files with 3,091 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Objective-C/advanced/APIDemo/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.DS_Store
*.swp
*.lock
profile
build/
*.pbxuser
*.mode1v3
*.mode2v3
*.perspectivev3
!default.pbxuser
!default.mode1v3
!default.mode2v3
!default.perspectivev3
xcuserdata
*.xcodeproj/project.xcworkspace
*.xcodeproj/xcuserdata
*.xccheckout
380 changes: 380 additions & 0 deletions Objective-C/advanced/APIDemo/APIDemo.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//
// Copyright (C) 2015 Google, Inc.
//
// AdMobAdDelegateViewController.h
// APIDemo
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

@import GoogleMobileAds;
@import UIKit;

@interface AdMobAdDelegateViewController : UIViewController

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
//
// Copyright (C) 2015 Google, Inc.
//
// AdMobAdDelegateViewController.m
// APIDemo
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

#import "AdMobAdDelegateViewController.h"

#import "Constants.h"

/// AdMob - Ad Delegate
/// Demonstrates handling GADBannerViewDelegate ad request status and ad click lifecycle messages.
@interface AdMobAdDelegateViewController () <GADBannerViewDelegate>

/// The banner view.
@property(nonatomic, weak) IBOutlet GADBannerView *bannerView;

@end

@implementation AdMobAdDelegateViewController

- (void)viewDidLoad {
[super viewDidLoad];
self.bannerView.delegate = self;

self.bannerView.adUnitID = kAdMobAdUnitID;
self.bannerView.rootViewController = self;

GADRequest *request = [GADRequest request];
[self.bannerView loadRequest:request];
}

#pragma mark - GADBannerViewDelegate

// Called when an ad request loaded an ad.
- (void)adViewDidReceiveAd:(GADBannerView *)adView {
NSLog(@"%s", __PRETTY_FUNCTION__);
}

// Called when an ad request failed.
- (void)adView:(GADBannerView *)adView didFailToReceiveAdWithError:(GADRequestError *)error {
NSLog(@"%s: %@", __PRETTY_FUNCTION__, error.localizedDescription);
}

// Called just before presenting the user a full screen view, such as a browser, in response to
// clicking on an ad.
- (void)adViewWillPresentScreen:(GADBannerView *)adView {
NSLog(@"%s", __PRETTY_FUNCTION__);
}

// Called just before dismissing a full screen view.
- (void)adViewWillDismissScreen:(GADBannerView *)adView {
NSLog(@"%s", __PRETTY_FUNCTION__);
}

// Called just after dismissing a full screen view.
- (void)adViewDidDismissScreen:(GADBannerView *)adView {
NSLog(@"%s", __PRETTY_FUNCTION__);
}

// Called just before the application will background or terminate because the user clicked on an ad
// that will launch another application (such as the App Store).
- (void)adViewWillLeaveApplication:(GADBannerView *)adView {
NSLog(@"%s", __PRETTY_FUNCTION__);
}

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
//
// Copyright (C) 2015 Google, Inc.
//
// AdMobAdTargetingTableViewController.h
// APIDemo
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//

@import GoogleMobileAds;
@import UIKit;

@interface AdMobAdTargetingTableViewController : UITableViewController

@end
Loading

0 comments on commit b246dd3

Please sign in to comment.