Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

After restart app stucks while getting firebase initial message #9

Open
xalikoutis opened this issue Sep 2, 2024 · 2 comments
Open

Comments

@xalikoutis
Copy link

xalikoutis commented Sep 2, 2024

Hi first of all thanks for the great plugin

Android: Works as expected, app restarts
IOS: Stucks while initializing my app and while getting the initial push message

RemoteMessage? message;
message = await firebaseAppConfig.firebaseMessaging.getInitialMessage();

i get no errors just stucks there

Do i have to register somehow the Firebase module in AppDelegate

import UIKit
import Flutter
import Firebase
import flutter_downloader
import app_links
import restart

@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
  override func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
  ) -> Bool {

    var flutter_native_splash = 1
    UIApplication.shared.isStatusBarHidden = false
    FirebaseApp.configure()
    print("Firebase configured")
    FlutterDownloaderPlugin.setPluginRegistrantCallback(registerPlugins)
    if #available(iOS 10.0, *) {
      UNUserNotificationCenter.current().delegate = self as? UNUserNotificationCenterDelegate
    }
    // Retrieve the link from parameters
    if let url = AppLinks.shared.getLink(launchOptions: launchOptions) {
          // We have a link, propagate it to your Flutter app
        AppLinks.shared.handleLink(url: url)
        return true // Returning true will stop the propagation to other packages
    }
    RestartPlugin.generatedPluginRegistrantRegisterCallback = { [weak self] in
              GeneratedPluginRegistrant.register(with: self!)
              print("RestartPlugin registered")
    }
    GeneratedPluginRegistrant.register(with: self)
    return super.application(application, didFinishLaunchingWithOptions: launchOptions)
  }
}

private func registerPlugins(registry: FlutterPluginRegistry) {
    if (!registry.hasPlugin("FlutterDownloaderPlugin")) {
       FlutterDownloaderPlugin.register(with: registry.registrar(forPlugin: "FlutterDownloaderPlugin")!)
    }
}
@xalikoutis xalikoutis changed the title After restart stucks while initialing firebase After restart stucks while initializing firebase Sep 2, 2024
@xalikoutis xalikoutis changed the title After restart stucks while initializing firebase After restart stucks while getting firebase initial message Sep 2, 2024
@xalikoutis xalikoutis changed the title After restart stucks while getting firebase initial message After restart app stucks while getting firebase initial message Sep 2, 2024
@Jayjaejae
Copy link

@xalikoutis did you solve the problem? I am getting the same issue. It stucks while launching the app with the splash screen.

@xalikoutis
Copy link
Author

@xalikoutis did you solve the problem? I am getting the same issue. It stucks while launching the app with the splash screen.

No nothing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants