question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

bug: Firebase Messaging not initialized

See original GitHub issue

Plugin(s):

Platform(s):

  • ios

Current behavior: I added the plugin to my capacitor app, set up push notifications and background modes. Added snippets as described to AppDelegate.swift and FirebaseAppDelegateProxyEnabled to Info.plist. Also added GoogleService-Info.plist to the xcode project.

After building and running the app on a mobile device, I see these errors in xcode logs:

[FirebaseCore][I-COR000003] The default Firebase app has not yet been configured. Add `FirebaseApp.configure()` to your application initialization. This can be done in in the App Delegate's application(_:didFinishLaunchingWithOptions:)` (or the `@main` struct's initializer in SwiftUI).

[FirebaseMessaging][I-FCM002023] The object <CapacitorFirebaseMessaging.FirebaseMessaging: 0x282da5380> does not respond to -messaging:didReceiveRegistrationToken:. Please implement -messaging:didReceiveRegistrationToken: to be provided with an FCM token.

Expected behavior: No warnings of uninitialized Firebase components in xcode log.

Steps to reproduce: build and run the app.

Related code:

Other information:

Capacitor doctor:

💊   Capacitor Doctor  💊 

Latest Dependencies:

  @capacitor/cli: 3.6.0
  @capacitor/core: 3.6.0
  @capacitor/android: 3.6.0
  @capacitor/ios: 3.6.0

Installed Dependencies:

  @capacitor/cli: 3.5.1
  @capacitor/core: 3.6.0
  @capacitor/android: 3.6.0
  @capacitor/ios: 3.6.0

[success] iOS looking great! 👌
[success] Android looking great! 👌

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:15 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
phal0rcommented, Jul 15, 2022

Now I am messing around with the code locally, but no luck so far. I even put it in the launch method as suggested from you and the firebase docs:

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        // Override point for customization after application launch.
        if FirebaseApp.app() == nil {
            FirebaseApp.configure()
        }
        
        return true
    }

And I still get this warning. So something is wrong with my local test app. I will dig a little deeper.

1reaction
phal0rcommented, Jul 13, 2022

Ok, I will prepare a testrepo. For Android it works as expected, only iOS is affected.

Read more comments on GitHub >

github_iconTop Results From Across the Web

android - FirebaseApp is not initialized - Stack Overflow
You can try to disconnect the project from the Firebase and reconnect again the project to Firebase. In my case is like this,...
Read more >
Troubleshoot initialization options | Firebase - Google
Your application may be using an incomplete or erroneous google-services.json configuration file ; or your app is programmatically initializing Firebase without ...
Read more >
Firebase Cloud Messaging Not Work - Niotron Community
Hello Niotron team we faced Firebase Cloud Messaging issue at very long time till the issue present and still this component not work...
Read more >
[firebase_auth][firebase_messaging] Firebase Dart ... - GitHub
A clean flutter (2.8.1) project won't initialise run correctly if firebase_auth and firebase_messaging are installed with iOS push notifications ...
Read more >
[Solved] No Firebase App '[DEFAULT]' has been created Error
While using Firebase services in Flutter, you may get ʺNo Firebase App '[DEFAULT]' has been created - call Firebase.initializeApp()ʺ Error in Flutter.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found