firebase-ios-sdk: Complition handler InstanceID.instanceID().instanceID is not called after FirebaseApp.configure()

[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

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 21 (9 by maintainers)

Commits related to this issue

Most upvoted comments

Thanks for the response. It now works. I managed to set the version for each dependency and my Podfile look like this now.

pod ‘Firebase/Core’, ‘5.19.0’ pod ‘FirebaseMessaging’, ‘3.4.0’ pod ‘FirebaseInstanceID’, ‘3.8.0’

Hello,

do you know the version of the library that corrects this problem? I still have this problem with the pod updated :

Using Firebase (5.20.1) Using FirebaseABTesting (2.0.0) Using FirebaseAnalytics (5.8.0) Using FirebaseAnalyticsInterop (1.2.0) Using FirebaseCore (5.4.1) Using FirebaseInAppMessaging (0.13.0) Using FirebaseInAppMessagingDisplay (0.13.1) Using FirebaseInstanceID (3.8.1) Using FirebaseMessaging (3.5.0) Using FirebasePerformance (2.2.4) Using FirebaseRemoteConfig (3.1.0)

thanks

this is an extract of my podfile.lock :

  • Firebase/Core (5.19.0):
    • Firebase/CoreOnly
    • FirebaseAnalytics (= 5.8.0)
    • Firebase/CoreOnly (5.19.0):
      • FirebaseCore (= 5.4.0)
    • Firebase/InAppMessagingDisplay (5.19.0):
      • Firebase/CoreOnly
      • FirebaseInAppMessagingDisplay (= 0.13.1)
    • Firebase/Messaging (5.19.0):
      • Firebase/CoreOnly
      • FirebaseMessaging (= 3.4.0)
    • Firebase/Performance (5.19.0):
      • Firebase/Core
      • FirebasePerformance (= 2.2.4)
    • FirebaseABTesting (2.0.0):
      • FirebaseCore (~> 5.0)
      • Protobuf (~> 3.5)
    • FirebaseAnalytics (5.8.0):
      • FirebaseCore (~> 5.4)
      • FirebaseInstanceID (~> 3.8)
      • GoogleAppMeasurement (= 5.8.0)
      • GoogleUtilities/AppDelegateSwizzler (~> 5.2)
      • GoogleUtilities/MethodSwizzler (~> 5.2)
      • GoogleUtilities/Network (~> 5.2)
      • “GoogleUtilities/NSData+zlib (~> 5.2)”
      • nanopb (~> 0.3)
    • FirebaseAnalyticsInterop (1.2.0)
    • FirebaseCore (5.4.0):
      • GoogleUtilities/Environment (~> 5.2)
      • GoogleUtilities/Logger (~> 5.2)
    • FirebaseInAppMessaging (0.13.0):
      • FirebaseAnalytics
      • FirebaseAnalyticsInterop
      • FirebaseCore
      • FirebaseInstanceID
    • FirebaseInAppMessagingDisplay (0.13.1):
      • FirebaseCore
      • FirebaseInAppMessaging (>= 0.12.0)
    • FirebaseInstanceID (3.8.0):
      • FirebaseCore (~> 5.2)
      • GoogleUtilities/Environment (~> 5.2)
      • GoogleUtilities/UserDefaults (~> 5.2)
    • FirebaseMessaging (3.4.0):
      • FirebaseAnalyticsInterop (~> 1.1)
      • FirebaseCore (~> 5.2)
      • FirebaseInstanceID (~> 3.6)
      • GoogleUtilities/Environment (~> 5.3)
      • GoogleUtilities/Reachability (~> 5.3)
      • GoogleUtilities/UserDefaults (~> 5.3)
      • Protobuf (~> 3.1)
    • FirebasePerformance (2.2.4):
      • FirebaseAnalytics (~> 5.8)
      • FirebaseInstanceID (~> 3.8)
      • FirebaseRemoteConfig (~> 3.1)
      • GoogleToolboxForMac/Logger (~> 2.1)
      • “GoogleToolboxForMac/NSData+zlib (~> 2.1)”
      • GoogleUtilities/ISASwizzler (~> 5.2)
      • GoogleUtilities/MethodSwizzler (~> 5.2)
      • GTMSessionFetcher/Core (~> 1.1)
      • Protobuf (~> 3.5)
    • FirebaseRemoteConfig (3.1.0):
      • FirebaseABTesting (~> 2.0)
      • FirebaseAnalytics (~> 5.3)
      • FirebaseCore (~> 5.1)
      • FirebaseInstanceID (~> 3.3)
      • GoogleUtilities/Environment (~> 5.2)
      • “GoogleUtilities/NSData+zlib (~> 5.2)”
      • Protobuf (~> 3.5)

@falipate It should be available in the next version.

Thanks you all 😃