首页 > 解决方案 > FCM 适用于 Firebase v3.4.1,但不适用于 v5.8.1

问题描述

基于 swift 3.2 制作了一个新项目。并使用了这个 pod 文件:

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

target 'PushNotifs' do
  # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
  use_frameworks!

  # Pods for PushNotifs
  pod 'Firebase/Core'
  pod 'Firebase/Messaging'

end

现在我把这个应用程序推送到我的 iPhone 6S 上进行测试。并发送了一条消息。有效。

几分钟后,基于 swift 4.0 创建了一个新项目并使用了这个 podfile:

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

    target 'Push 7' do
      # Comment the next line if you're not using Swift and don't want to use dynamic frameworks
      use_frameworks!

      # Pods for Push 7

      # Pods for PushNotifs
       pod 'Firebase/Core'
       pod 'Firebase/Messaging'

       pod 'Firebase/Database'
       pod 'Firebase/Firestore'
       pod 'Firebase/Auth'
       pod 'GRDB.swift', '2.10.0'
       pod 'Alamofire'
       pod 'DeckTransition', '~> 2.0'
       pod 'Fabric', '~> 1.7.9'
       pod 'Crashlytics', '~> 3.10.5'
       pod 'SCLAlertView'

  end

后来做了一个pod install并得到以下回复:

    Analyzing dependencies
Removing GoogleToolboxForMac
Downloading dependencies
Installing Alamofire (4.7.3)
Installing BoringSSL (10.0.6)
Installing Crashlytics (3.10.7)
Installing DeckTransition (2.1.0)
Installing Fabric (1.7.11)
Installing Firebase 5.8.1 (was 3.14.0)
Installing FirebaseAnalytics 5.1.4 (was 3.7.0 and source changed to `https://github.com/CocoaPods/Specs.git` from `https://github.com/cocoapods/specs.git`)
Installing FirebaseAuth (5.0.4)
Installing FirebaseAuthInterop (1.0.0)
Installing FirebaseCore 5.1.3 (was 3.5.1 and source changed to `https://github.com/CocoaPods/Specs.git` from `https://github.com/cocoapods/specs.git`)
Installing FirebaseDatabase (5.0.3)
Installing FirebaseFirestore (0.13.3)
Installing FirebaseInstanceID 3.2.1 (was 1.0.9 and source changed to `https://github.com/CocoaPods/Specs.git` from `https://github.com/cocoapods/specs.git`)
Installing FirebaseMessaging 3.1.2 (was 1.2.2 and source changed to `https://github.com/CocoaPods/Specs.git` from `https://github.com/cocoapods/specs.git`)
Installing GRDB.swift (2.10.0)
Installing GTMSessionFetcher (1.2.0)
Installing GoogleAppMeasurement (5.1.4)
Installing GoogleUtilities (5.3.0)
Using Protobuf (3.6.1)
Installing SCLAlertView (0.8)
Installing gRPC (1.14.0)
Installing gRPC-C++ (0.0.3)
Installing gRPC-Core (1.14.0)
Installing gRPC-ProtoRPC (1.14.0)
Installing gRPC-RxLibrary (1.14.0)
Installing leveldb-library (1.20)
Installing nanopb (0.3.8)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There are 11 dependencies from the Podfile and 27 total pods installed.

现在我假设我有firebase v5.8.1。出色地。现在我无法通过 FCM 接收消息,消息已发送但在设备上未收到

我需要帮助。谢谢

标签: swiftxcodefirebasecocoapodsfirebase-cloud-messaging

解决方案


推荐阅读