Skip to content

Complition handler InstanceID.instanceID().instanceID is not called after FirebaseApp.configure() #2445

Closed
@MamuninaNV

Description

@MamuninaNV

[READ] Step 1: Are you in the right place?

Yes

[REQUIRED] Step 2: Describe your environment

  • Xcode version: 10.1 (10B61)
  • Firebase SDK version: 5.17.0
  • Firebase Component: Core
  • Component version: 5.3.0

[REQUIRED] Step 3: Describe the problem

Steps to reproduce:

following is in my pod file of a new project

  pod 'Firebase/Core', '~> 5.17.0'

Relevant Code:

Completion handler NEVER get called. Nor result or error

import Firebase
import UIKit

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
    var window: UIWindow?

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
        FirebaseApp.configure()
        InstanceID.instanceID().instanceID { (result, error) in
                // Not called
        }

        return true
    }
}

But if add delay, like that:

        DispatchQueue.main.asyncAfter(deadline: (.now() + 0.3)) {
            InstanceID.instanceID().instanceID { (result, error) in
                // Get called
            }
        }

All is work

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions