ios - 无法在 objective-c AppDelegate.h 中导入 FirebaseMessaging

标签 ios objective-c firebase push-notification firebase-authentication

当我写@import FirebaseMessaging; 时,它说 -

未找到模块“FirebaseMessaging”

我做了什么 - 起初我只安装了 Firebase/Core 的 pod,但后来我意识到 Firebase/Messaging 也是必要的. 然后我在 pod 文件中写入 pod 'Firebase/Messaging' 并再次安装 pod。

pod 文件夹包含作为 Firebase Messaging 的文件夹,但是当我导入它时它说找不到模块。 Here is the screenshot of the error

最佳答案

根据documentation,您不需要在最新的Firebase SDK 中单独导入FirebaseMessaging :

You'll need to add Firebase initialization code to your application. Import the Firebase module and configure a shared instance as shown:

  1. Import the Firebase module in your UIApplicationDelegate:
@import Firebase;
  1. Configure a FirebaseApp shared instance, typically in your application's application:didFinishLaunchingWithOptions: method:
// Use Firebase library to configure APIs
[FIRApp configure];

关于ios - 无法在 objective-c AppDelegate.h 中导入 FirebaseMessaging,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51279927/

相关文章:

ios - 如何禁用 UITableViewCell 但仍与附属 View (即 UISwitch)进行交互

ios - 缺少 (null) 的 ios 开发签名身份

iphone - 动画调整 UITableView 的 UIView 标题

objective-c - 有没有办法为 iOS 解锁屏幕提供自定义用户身份验证过程?

ios - 来自Objective-C中URL的数组

swift - handleOpenURL,第二个参数(sourceApplication)使用什么值?

iphone - 使用地址簿委托(delegate)方法时在 xcode 上转换错误

ios - 如何将 TabBar 图像添加到每个选项卡?在 XCode 8.1 上

android - 具有多个项目的 Firebase google-services.json?

ios - 如何使用 Firebase 跟踪 iOS 应用程序卸载/删除事件?