iOS: Wrong instruction in installing Google Mobile Ads SDK?

Remove the cocoapods line from the instruction and replace with this line:

pod 'Google-Mobile-Ads-SDK'

It will install the google sdk version 7.9.0 and you'll see the configureWithApplicationID method. This is the error from Google for Swift.


Xcode 7.3, iOS9.3.3

Followed the instructions above, but wanted to expand, in hopes of saving someone time. If you had 'Google-Mobile-Ads-SDK' pod already installed, then check the version to make sure it is 7.9.0+. Otherwise, you will keep installing the old version over and over.

To update the version, follow the instruction taken from Cocoapods website https://cocoapods.org/pods/Google-Mobile-Ads-SDK click "Installation Guide" (bottom right):

enter image description here

The '~> 7.9' bit will force an update.

What I had that did not work:

enter image description here

What it needs to be:

enter image description here

Again, note the version is 7.9.1

The Podfile looks like this:

# Uncomment this line to define a global platform for your project
# platform :ios, '9.0'

target 'AppName' do
  # Uncomment this line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for AppName

  pod 'Firebase'
  pod 'Google-Mobile-Ads-SDK', '~> 7.9'

  target 'AppNameTests' do
    inherit! :search_paths
    # Pods for testing
  end
end

Now you will be able to configure GADMobileAds with the Google prescribed method:

[GADMobileAds configureWithApplicationID:@""];

Or the Swift equivalent:

GADMobileAds.configureWithApplicationID("");

Hope this helps! Cheers.

Tags:

Ios

Admob