GOOGLE ADMOB INTEGRATION FOR iOS APPS

4 min


0

AdMob is Google’s promoting platform for selling and monetising cellular purposes. AdMob’s platform does majority of the be just right for you so you may concentrate on enhancing your app whereas creating wealth from it. You even have management over the varieties of advert codecs you permit.

TYPES OF ADMOB ADS:

presently, AdMob has 4 several types of Ads specifically:

  1. Banner Ad
  2. Interstitial Ad
  3. Native Ad
  4. Rewarded Ad
  1. Banner Ad

Banner adverts are rectangular picture or textual content adverts that occupy a spot inside an app’s format. They keep on display screen whereas customers are interacting with the app, and might refresh robotically after a sure time frame. If you’re new to cellular promoting, they’re an ideal place to start out.

2. Interstitial Ad

Interstitials are full-screen adverts that cowl the interface of an app till closed by the consumer. They’re finest used at pure pauses within the movement of an app’s execution, comparable to between ranges of a sport or simply after a process is accomplished.

   3.  Native Ad

Native is a component-based advert format that offers you the liberty to customise the way in which property comparable to headlines and calls to motion are introduced in your apps. By selecting fonts, colours, and different particulars your self, you may create pure, unobtrusive advert shows that may add to a wealthy consumer expertise.

  4.  Rewarded Ad

Rewarded video adverts are full-screen video adverts that customers have the choice of watching of their entirety in alternate for in-app rewards.

In this weblog we are going to construct a easy Banner Ad that AdMob helps, for this letshave a glance into AdMob account creation.

1 . HOW TO MAKE AN ADMOB ACCOUNT?

  • Read all phrases and situation and settle for it.
  • Once you comply with all of the steps your account shall be created and you can be landed on the house web page of your AdMob account which seems like under screenshot.

2. HOW TO GENERATE AD UNIT FOR iOS APP?

Generating Ad unit ID for all of the Ads i.e Banner Ad, Native Ad, Rewarded Ad and Interstitial Ad is analogous. Follow the under steps to generate Ad Unit ID.

  • Click on Apps out there on the left facet of the dashboard of your AdMob account and choose “ADD YOUR FIRST APP” Button.
  • In subsequent display screen, you’re going to get a query that Have you revealed your app on Google Play or the App Store?” and there choose “NO”button.
  • This time you can be redirected to the app data web page, there you may enter your App Name and choose your Platform (iOS).
  • Congrats! Your app has been added to AdMob. You shall be redirected to the web page which will provide you with App ID which seems like “ca-app-pub-45523246750xxxxx~57027xxxxx”. In the identical web page you must choose “CREATE UNIT ID” button for creating Unit ID to your Banner Ad.
  • In the following web page you can be redirected to the display screen, which shall be having record of banner sorts by displaying like Banner Ad, Interstitial Ad and Rewarded Ad. As we’re constructing App for Banner, you may choose “Banner”.
  • In the Next web page you may see the Ad format as Banner and you must give the identify of Ad Unit and click on on “CREATE AD UNIT”.
  • Congrats! Now your Ad unit efficiently created. In that web page you may in a position to see each of your App ID and advert unit ID, which seems like as under.

App ID: “ca-app-pub-45523246750xxxxx~57027xxxxx”

Ad Unit ID: “ca-app-pub-45523246750xxxxx/47689xxxxx

  • Click Done if in case you have completed or hit on Create Another AD Unit to create one other app ID and Unit ID.
  • For all above course of of making App ID and Unit ID, right here I’m attaching some screenshots to your reference. Please take a look.

Now App ID and Unit ID created. So we are going to soar on coding half !!! Now Lets see the way to Integrate Admob into our iOS Applications, with our all above credentials.

3. INTEGRATING ADMOB INTO IOS APPS

  • Open Xcode , Create new file by clicking FILE => New => FILE. Now you may select a template to your new file as “Cocoa Touch Class” , click on on Next and Give a category identify what ever you need and click on on “Next”. (In my challenge I’ve given class identify as ViewController).
  • Now Open AppDelegate.m file and importGoogleCellAds” SDK and place your App ID in utility didFinishLaunchingWithChoices Method as proven under display screen shot.

4. CREATING BANNER VIEW

  • Now It’s time to create a view for Banner Ad and set width, top positions for that in viewDidLoad. So for creating banner view lets first declare a property for that in ViewController’s Interface space,and in that declare one methodology for banner request. (A banner request is Specifies non-compulsory parameters for advert requests,and the tactic which was created by us is returns a default request by implementing banner delegates.). Implement delegate for banner advert implementation. The code for banner creation is proven under.

#import "ViewController.h"
@import GoogleCellAds;

@interface ViewController ()<GADBannerViewDelegate>
//@property(nonatomic, robust) GADBannerView *bannerView;
-(GADRequest *)Createrequest;
@property (weak, nonatomic) IBOutlet GADBannerView *bannerView;

@finish

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];

    // Creating Banner Ads !
  
   _bannerView.delegate = self;
    self.bannerView.advertUnitID=@"ca-app-pub-9429798427460185/9675986153";
//    [self.bannerView setRootViewController:self];
    [self.bannerView loadRequest:[self Createrequest]];
    
}

 5.IMPLEMENTING BANNER DELEGATE

  • To dealing with AdMob,Apple has supplied some Delegate strategies, Which are

1) bannerView didFailToObtainAdWithError

2)adViewDidReceiveAd

1) bannerView didFailToObtainAdWithError:

As the identify means that when ever is there any error happens whereas we’re working with AdMob’s this methodology shall be handles these occasions.

adViewDidReceiveAd:

So if the whole lot goes easily, and our code executes wonderful, and our App ID, Unit ID..and many others shall be works wonderful, the banner request shall be executed by this methodology and you may in a position to see our Banner Ad.

  • So the implementation strategy of GADBannerViewDelegate is proven under code.
#pragma Mark--- GADBannerView Delegate Methods
-(GADRequest *)Createrequest

{
    GADRequest *request=[GADRequest request];
    return request;
}

-(void)adView:(GADBannerView *)bannerView didFailToObtainAdWithError:(GADRequestError *)error

{
    NSLog(@"Failed With Error %@",[error localizedFailureReason]);
}

-(void)adViewDidReceiveAd:(GADBannerView *)adView

{

    NSLog(@"The received add is %@",adView);
 
    [self.bannerView setHidden:NO];
}
@finish

Now Everything was executed. You can Run your utility.. Now you may in a position to see your First banner Ad developed by you Cheers ..!!!

You can see Our Banner Ad in under screenshot.

The put up GOOGLE ADMOB INTEGRATION FOR iOS APPS appeared first on Custom Software Development Services | Ahex Technologies.


What's Your Reaction?

hate hate
0
hate
confused confused
0
confused
fail fail
0
fail
fun fun
0
fun
geeky geeky
0
geeky
love love
0
love
lol lol
0
lol
omg omg
0
omg
win win
0
win

0 Comments

Your email address will not be published. Required fields are marked *

Choose A Format
Trivia quiz
Series of questions with right and wrong answers that intends to check knowledge
Poll
Voting to make decisions or determine opinions
Story
Formatted Text with Embeds and Visuals
List
The Classic Internet Listicles
Meme
Upload your own images to make custom memes
Video
Youtube, Vimeo or Vine Embeds
Audio
Soundcloud or Mixcloud Embeds
Image
Photo or GIF
Gif
GIF format