IAD programming materials

Source: Internet
Author: User
Tags admob

How to add IAD banner in iPhone apphttp: // IAD mobile advertising system Knowledge Overview how to hide ad strips when no ads are obtained. Http://www.cocoachina.com/bbs/read.php? Tid-24414-page-1.html on the second page of the post, there is a solution for iPhone pop-up phonegap-based engineering AdMob ads

The knowledge about phonegap and AdMob will not be mentioned. If you use it, you will certainly know it. here we will talk about the steps directly.

Step 1: Open xcode and create a phonegap-based project.

Step 2: add the AdMob header file and the. A file. (For how to add a third-party library, refer to my article: add a third-party library in xcode)

Step 3: Add # import "gadbannerview. H" to the header file of appdelegate"

Step 4: declare an instance variable gadbannerview * gbannerview in the header file of appdelegate;

Step 5: Add the following code to the webviewdidfinishload function in the appdelegate. M file:

Gbannerview = [[gadbannerview alloc] init];
[Gbannerview setdelegate: Self];
[Gbannerview setframe: cgrectmake (0, 0,320, 50)];

Gbannerview. adunitid = @ "ID of the AdMob publisher you applied for"; // my ID is a14f0aabcbd12cd. If you don't mind, please help me advertise!

Gbannerview. rootviewcontroller = self. viewcontroller;
Gbannerview. backgroundcolor = [uicolor greencolor];
[Self. viewcontroller. View addsubview: gbannerview];

[Gbannerview loadrequest: [gadrequest request];

Step 6: Open phonegap. plist and find externalhots. Generally, it is 0 items.
Click "+" next to it, add an item, and enter *

(If this step is not added, the error whitelist rejection error will be reported)

The following is my work, I hope everyone to evaluate: parenting http://itunes.apple.com/us/app/yu-er-bao-dian/id557095677? Ls = 1 & mt = 8

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.