简体   繁体   English

如何在Swift 3中集成AdMob广告?

[英]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 一直努力将AdMob广告手动实施到我的iOS应用中,但是没有运气-我将GoogleMobileAds.framework插入了ViewController.swift和AppDelegate.swift所在的项目文件夹中,并在“链接的框架和库”下添加了所有必需的框架,并将位码更改为构建设置中的“否”

Typed 'import GoogleMobileAds' in ViewControllerSwift.swift but it states 'No such module GoogleMobileAds' 在ViewControllerSwift.swift中输入“ import GoogleMobileAds”,但显示“没有此类模块GoogleMobileAds”

What am I missing here? 我在这里想念什么? Im using XCode 8.3.3 and Swift 3 我正在使用XCode 8.3.3和Swift 3

Admob is part of Firebase now so install pod files below and then try to import GoogleMobileAds Admob现在是Firebase的一部分,因此请在下面安装Pod文件,然后尝试import GoogleMobileAds

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

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

Read the manuals more carefully 更仔细地阅读手册

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

$ sudo gem install cocoapods

2. 2。

$ cd your-project directory
$ pod init
  1. Edit PodFile: add this code inside target rows 编辑PodFile:将此代码添加到目标行中
 pod 'Firebase/Core' pod 'Firebase/Admob' 

4. 4。

$ pod install
$ open your-project.xcworkspace

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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