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
- Fix handler for multiple calls of -[FIRInstanceID instanceIDWithHandler:] (#2445) (#2559) — committed to firebase/firebase-ios-sdk by maksymmalyhin 5 years ago
- Fix handler for multiple calls of -[FIRInstanceID instanceIDWithHandler:] (#2445) (#2559) — committed to firebase/firebase-ios-sdk by maksymmalyhin 5 years ago
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 :
@falipate It should be available in the next version.
Thanks you all 😃