INSTALL ADVERTISING IN APPLICATIONS USING ADMOB GOOGLE

In this INSTALL ADVERTISING IN APPLICATIONS USING ADMOB GOOGLE, I am demonstrating how to show promotions in your iOS Applications utilizing the Google SDK for AdMob. An ideal method to profit from applications.

I have had many individuals as of late message in to get some information about what's going on with iAds. Also, what options are there out there with the goal that individuals don't free their income stream. I chose to make a fast instructional exercise to tell you the best way to coordinate the Google AdMobs SDK for iOS into your application.

INSTALL ADVERTISING IN APPLICATIONS USING ADMOB GOOGLE :
In Application Promoting
All in all, what is in Application Promoting? Indeed, you more likely than not seen them around. Practically all free applications have a type of promoting in them, either flag advertisements at the base or top of the application, or those full screen advertisements that popup (Interstitial promotions). All through this how to add publicizing to versatile applications instructional exercise I am demonstrating how to execute Flag advertisements in Quick and how to actualize interstitial promotions in Quick all utilizing the Google AdMob SDK.

In this way, how about we feel free to begin. The main thing we will do is proceed to get the most recent rendition of the Google AdMob SDK and download it with the goal that we can utilize it in this instructional exercise.


Get the Google AdMob SDK 

INSTALL ADVERTISING IN APPLICATIONS USING ADMOB GOOGLE  AdMob expects you to have a legitimate AdSense record and AdWords account. All through this Google AdMob Instructional exercise you will see codes like: ca-application bar 3940256099942544/2934735716. These are just test codes given by Google. When you make your own and connection up an application you will get one of a kind ones. These codes are fine with the end goal of this Quick Instructional exercise.

Go to: https://developers.google.com . You should see this amidst the screen:


GoogleAdmob SDK Alternatives 

Snap the catch in the center iOS. This will at that point take you to the "Google APIs for iOS" page. Down the page, there are three sections. This page is responsive so the format may be diverse we are searching for the area with the title: "Acquire". As appeared as follows:



Gain cash with Google AdMob

Snap the connection that says AdMob.

There are currently some new connections, Snap the one that says download:

           
                 AdMob for ios download

This page currently has a table of all the accessible downloads. The one we are utilizing in this AdMob Instructional exercise is:
   

          google admob stable discharge

Hold up a second, you simply influenced me to go all around the Google Admob site when you could have quite recently connected the venture structure here? All things considered, definitely I could have, yet not for long. Google, in the same way as other over specialist organizations are continually bringing out updates, variant forms just as site structure changes. It is dependably a smart thought to get a commonplace design of the source site with the goal that you can without much of a stretch discover your way around should you need the record once more. In this way, in that regard.. The pleasure is all mine. 🙂

Make the Venture

In Xcode, make another Single View Application. Call this whatever you like. Here is the data that I have utilized.

             
Google AdMob Instructional exercise Task

When you have done that, Xcode will ask you where you need to store the Google AdMob Instructional exercise venture. Picked an area of your craving and spare.

Duplicate the whole envelope of the Google AdMob SDK that you just downloaded crosswise over into this venture organizer. I made an envelope called "SDKs" as I like to keep things perfect and clean.

Connecting Google AdMob to our undertaking

In Xcode, in the undertaking route select the name of your task:

     

          GoogleAdMob Undertaking Route

Over the highest point of the Xcode Editorial manager Region, There are currently a couple of areas. Snap the one that says Fabricate Stages. As should be obvious currently, there are 4 limited dropdown sheets. Snap the one that says Connection Parallel With Library so it is open like so:

                     
AdMob Instructional exercise        Connection Library

Open another discoverer window, go to the area of the Google SDK and simplified the GoogleMobileAds.framework into the segment above. You presently ought to have:

       Connected GoogleAdMobs System

There are likewise some different systems that we have to add to the task which the Google AdMob Instructional exercise Undertaking requires. While still in the Connected Double with Libraries area click the in addition to + catch at the base. This will open up another exchange window, utilize the pursuit at the highest point of that window to scan for the accompanying systems and include them:


  • AdSupport.framework
  • AudioToolbox.framework
  • AVFoundation.framework
  • CoreGraphics.framework
  • CoreTelephony.framework
  • EventKit.framework
  • EventKitUI.framework
  • MessageUI.framework
  • StoreKit.framework
  • SystemConfiguration.framework


You should now observe this:

GoogleAdMob Every single Connected Library

Snap expand on your application or CMD + B. I like to do this since certain systems dont import legitimately except if Xcode realizes the structure is there before you import it.

Import GoogleMobileAds

Presently, in your undertaking route sheet, Snap the ViewController.Swift record and at the extremely top include

Presently your venture is prepared to begin including the promotions. Construct your undertaking again and spare.

       
 Create Admob Ads

In your undertaking route sheet, select the Main.storyboard.

In the item Library, scan for a UIView:


Xcode Item Library

What's more, drag one onto your storyboard, I hauled mine to the base of the storyboard and focused it:

uiview storyboard

Snap the UIView that you just included with the goal that it is chosen. At that point go to the Size Examiner and change the four qualities to the ones appeared as follows:

UIView Measure Controller

Vital Advance, Focus!

Presently, this is fundamental. Snap the UIView while additionally holding down the CTRL catch and drag to one side, inside the UIView:

UIView Width

This will raise a blue line. When you let go you will see a little exchange window that will spring up. Snap Width at the top:


UIView Connection Width

Do the equivalent once more, however this time drag the blue line up and click tallness structure the exchange window.

With the UIView Still Chosen, Snap the Auto Requirements catch (Featured red beneath) At that point select "Include Missing Imperatives":



UIView Include Missing Limitations

Once more, With the UIView Still Chose, go to the Character Examiner and change the class to GADBannerView



Google AdMob Instructional exercise Class-GADBannerView

In your VieController.Swift document make an IBOutlet for your GADBannerView and call it: GoogleBannerView of sort:

GADBannerView like so:

@IBOutlet feeble var GoogleBannerView: GADBannerView!

Connection that to the UIView on your storyboard.

Presently, in the ViewDidLoad strategy we are going to stack the promotion:

GoogleBannerView.adUnitID = "ca-application bar 3940256099942544/2934735716"
GoogleBannerView.rootViewController = self
GoogleBannerView.loadRequest(GADRequest())

You may get this mistake:

Application Transport Security has hindered a cleartext (http://) asset load since it is shaky. Transitory special cases can be designed through your application's Info.plist document.

This is on the grounds that you need to set the NSAllowsArbitraryLoads key to YES under NSAppTransportSecurity word reference in your .plist document.

          application transport security

There you have it. Run your application and you should see:

Google AdMob Instructional exercise Result


Creat AdMob Interstitial Ads

Along these lines, above I told you the best way to show standard advertisements in quick, presently I am demonstrating How to execute Interstitial promotions.

Interstitial advertisements are full screen promotions that are overlayed over an application. They are for the most part shown at normal application progress focuses, for example, in the middle of amusement levels. Interstitial advertisements are a 'one-time' just occasion. You have to reinitialize them each time you need to utilize. We will get around this by making a strategy that will re-instate it for us.

From the Xcode object library, Drag a UIButton onto your storyboard. Double tap and change the content to "Show Interstitial Promotion":

Google AdMob Interstitial Promotion

then in INSTALLING ADVERT IN THE APPLICATION USING THE GOOGLE ADMOB Snap the Associate Supervisor Catch to demonstrate the ViewController.Swift record by your storyboard in a split view. CTRL + haul from the UIButton to the ViewController.Swift document to make a connection. This will give you another discourse window. Change the association type to: Activity and name it showAd. At that point Snap Interface:

AdMob Interstitial Advertisement IBAction

This should include an IBAction into your ViewController.Swift document:

@IBAction func showAd(sender: AnyObject) {
}

We are not going to make a variable property for our AdMob Interstitial Promotion just beneath the class ViewController: UIViewController

var interstitialAd : GADInterstitial!

In this way, recall me saying before about interstitial promotions not been re-usable. This is the strategy that will re-introduce them for us:

func reloadInterstitialAd() - > GADInterstitial {
var interstitial = GADInterstitial(adUnitID: "ca-application bar 3940256099942544/4411468910")
interstitial.delegate = self
interstitial.loadRequest(GADRequest())
return interstitial
}

Do you get this blunder?:

Can't allot estimation of sort 'ViewController' to type 'GADInterstitialDelegate?'

This implies your ViewController does not comply with the sort GADInterstitialDelegate, to fix this, change:

class ViewController: UIViewController, UITextFieldDelegate {

to this:

class ViewController: UIViewController, UITextFieldDelegate, GADInterstitialDelegate {

No we are going to utilize interstitialDidDismissScreen to preload another interstitial following the past one is expelled, which means the application is set up to demonstrate an interstitial promotion again at the following intelligent break point:

func interstitialDidDismissScreen(ad: GADInterstitial!) {
self.interstitialAd = reloadInterstitialAd()
}

In the ViewDidload, include:

self.interstitialAd = GADInterstitial(adUnitID: "ca-application bar 3940256099942544/4411468910")
let demand = GADRequest()
request.testDevices = ["2077ef9a63d2b398840261c8221a0c9b"]
self.interstitialAd.loadRequest(request)
self.interstitialAd = reloadInterstitialAd()

Finally, we are not going to make the IBAction that we created earlier actually load an interstitial ad.
We do not want to try and get the interstitial until it has loaded, otherwise we will get all sorts of results, so we are going to be using: self.interstitialAd.isReady

@IBAction func showAd(sender: AnyObject) {
    if self.interstitialAd.isReady {
        self.interstitialAd.presentFromRootViewController(self)
    }
}

tl;dr Download Project Files

This content is locked!
Please support us, use one of the buttons below to unlock the content.
Run the app and press the button. Voila.


that's the explanation about  

INSTALL ADVERTISING IN APPLICATIONS USING ADMOB GOOGLE

having issues?

We have a Questions and Answer section where you can ask your iOS Development questions to thousands of iOS Developers.
ASK QUESTION
Newest
Previous
Next Post »

INSTALL ADVERTISING IN APPLICATIONS USING ADMOB GOOGLE

In this INSTALL ADVERTISING IN APPLICATIONS USING ADMOB GOOGLE , I am demonstrating how to show promotions in your iOS Applications utilizin...