关于在现有的iOS应用中集成Firebase的链接问题

问题描述 投票:0回答:2

更新(1月21日)

有关我要解决的问题的更多详细信息:

我正在使用XCode构建iOS应用,我的目标是将Firebase集成到我的应用中,这样我就可以获取崩溃报告(来自Crashlytics)以及Firebase的分析数据。我已按照本页https://firebase.google.com/docs/ios/setup上的说明进行操作。但是,当我尝试使用Firebase控制台(https://console.firebase.google.com/u/0/)完成SDK设置时,步骤4永远不会完成并保持挂起状态。 Firebase控制台似乎无法识别客户端上的集成。这是我指的控制台的屏幕截图:

enter image description here

也请注意,安装说明页面上的说明并不要求使用Firestore。因此,我的应用程序委托中没有它。这是我的应用程序委托中的集成片段:

import Firebase

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
    FirebaseApp.configure()
}

我也在使用CocoaPods集成Firebase。我正在使用的Firebase版本为6.14.0。这是我在Podfile中使用的库列表:

platform :ios, '11.0'

target 'MyApplication' do
    use_frameworks!

    pod 'Amplitude-iOS', '~> 4.6'
    pod 'Crashlytics', '~> 3.13'
    pod 'Fabric', '~> 1.10'
    pod 'FBSDKCoreKit', '~> 5.6'
    pod 'FBSDKLoginKit', '~> 5.6'
    pod 'FBSDKShareKit', '~> 5.6'
    pod 'Firebase/Core'
    pod 'FirebaseAuth'
    pod 'Firebase/Messaging'
    pod 'Google-Mobile-Ads-SDK', '~> 7.46'
    pod 'GoogleSignIn', '~> 4.4'
    pod 'AWSS3', '~> 2.9'
    pod 'TwitterKit', '~> 3.4'
    pod 'Branch', '~> 0.27'
    pod 'AppsFlyerFramework', '~> 4.10'
    pod 'UIScreenExtension', :git => 'https://github.com/marchv/UIScreenExtension'
    pod 'PersonalizedAdConsent', '~> 1.0'
    pod 'WhirlyGlobe', :git => 'https://github.com/mousebird/WhirlyGlobe'
    pod 'WhirlyGlobeResources', '~> 2.3'
    pod 'Keychain', '~> 0.3'
    pod 'Purchases', '~> 2.6'
    pod 'CryptoSwift', '~> 1.3'
end

任何帮助将不胜感激。谢谢。


我正在尝试将Firebase添加到我现有的iOS应用中。我正在按照Firebase documentation的所有步骤进行操作,但它始终挂在安装过程的最后一步(步骤:运行您的应用以验证安装)。我已经删除了该应用并重新安装。我确保整个应用程序中只有一个对FirebaseApp.configure()语句的调用。我也没有在我的应用程序中使用任何Firebase数据库集成。启动应用程序时,我在控制台中始终看到以下内容:

[[Firebase / Core] [I-COR000003]尚未配置默认Firebase应用。将[FIRApp configure];(在Swift中为FirebaseApp.configure())添加到应用程序初始化中。

CocoaPods版本:1.6.1FirebaseCore版本:6.5Firebase版本:6.14

知道发生了什么,为什么它无法完成安装并将我的应用程序链接到Firebase控制台?我正在使用CocoaPods进行集成。

任何帮助将不胜感激。谢谢

ios swift firebase cocoapods firebase-console
2个回答
1
投票

嗯,很奇怪。当您在Firebase中创建新项目时,它会创建一个info.plist文件(这是Google的文件),您是否将其放入了项目中?

在“ AppDelegate”文件中,您必须放置文档中所说的内容:

import Firebase

class AppDelegate: UIResponder, UIApplicationDelegate {
    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {

        FirebaseApp.configure()
        let db = Firestore.firestore()
        print(db)

        return true
   }
}

请记住,当您在Firebase中创建项目时,必须将显示在Xcode项目中的包ID放入。


0
投票

这可能是或不是全部答案,但这是其中的一部分。

© www.soinside.com 2019 - 2024. All rights reserved.