简体   繁体   中英

How to integrate AdMob ads in Swift 3?

Constantly struggling to implement AdMob ads into my iOS app manually but no luck - I have inserted GoogleMobileAds.framework in project folder where the ViewController.swift and AppDelegate.swift was & added all required frameworks under 'Linked Frameworks and Libraries', changed Bitcode to 'NO' in Build Settings

Typed 'import GoogleMobileAds' in ViewControllerSwift.swift but it states 'No such module GoogleMobileAds'

What am I missing here? Im using XCode 8.3.3 and Swift 3

Admob is part of Firebase now so install pod files below and then try to import GoogleMobileAds

pod 'Firebase/Core'
pod 'Firebase/AdMob'

https://firebase.google.com/docs/ios/setup

Read the manuals more carefully

  1. install cocoapods https://guides.cocoapods.org/using/getting-started.html

$ sudo gem install cocoapods

2.

$ cd your-project directory
$ pod init
  1. Edit PodFile: add this code inside target rows
 pod 'Firebase/Core' pod 'Firebase/Admob' 

4.

$ pod install
$ open your-project.xcworkspace

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM