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