Adding a Google AdMob(6.2.1) to Your Application

Introduction

The Google AdMob Ads SDK allows developers to easily incorporate mobile-friendly text and image banners as well as rich, full-screen web apps known as interstitials. An ever-growing set of "calls-to-action" are supported in response to user touch including direct access to the App Store, Android Market and Windows Phone 7 Marketplace, iTunes, maps, video and the dialer. Ads can be targeted by location and demographic data. The Google AdMob Ads SDK can be used by the following publishers:

AdMob publishers
Access the Google AdMob network to easily monetize your application.
DoubleClick For Publishers (DFP) users
Leverage DFP to traffic, target and serve directly-sold ads. For upgraded DFP ( www.google.com/dfp) users, select  Android or  iOS.
AdSense publishers
Monetize your search results pages with Google search ads.

Follow the instructions below to incorporate the Google AdMob Ads SDK into your development environment. To begin, select the tab corresponding to your particular platform.

iOS Android Windows Phone 7

Requirements

  • iOS version 4.3 or later
  • Xcode 4.5 or later

Warning: All new iPad and iPhone apps created after October 14, 2011 will require an AdMob SDK that was released on or after March 15, 2011. This corresponds to version 4.0.2+ for iOS. If you downloaded the library from our official download site, then you're already set. Otherwise you may have an old version of the AdMob SDK that was released prior to March 15, 2011, and your new app will not receive any ad impressions until you update your SDK.

Incorporating the SDK

For the rest of these instructions, the project shown will be named  BannerExample. When going through the exercises, simply replace  BannerExample with your project's name.

The decompressed SDK consists of Objective-C headers, a runtime library and a README.

1. Right-click on your project in Xcode, choose Add Files to "BannerExample"...

 

2. Add everything except the add-ons folder unless you need something from there. The add-ons folder includes headers for DFP and mediation, as well as the Analytics library. Even if you are adding these in, do not add any other Xcode projects into your project.

3. The SDK library references four iOS development frameworks which may not already be part of your project:

  • StoreKit
  • AudioToolbox
  • MessageUI
  • SystemConfiguration
  • CoreGraphics
  • AdSupport
To add these frameworks, double-click the  BannerExample project name. Open the  Link Binary With Libraries dropdown under the  Build Phases tab. Add the frameworks from the iOS SDK using the  + button that becomes visible.

4. You now need to add -ObjC to the Other Linker Flags of your application target's build setting:

  1. In Xcode's project navigator, press the blue top-level project icon.
  2. Click on your target, then the Build Settings tab.
  3. Under Other Linker Flags, add -ObjC to both Debug and Release.

You should now be able to rebuild your project without any errors.

你可能感兴趣的:(Adding a Google AdMob(6.2.1) to Your Application)