-
Notifications
You must be signed in to change notification settings - Fork 1
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
Initialize modules individually #2
Comments
I think you could handle your thread to initialize firebase completely so that there is only one initialization thread instead of multiple public bool IsInitCompleted { get; private set; }
Firebase.FirebaseApp.CheckAndFixDependenciesAsync().ContinueWithOnMainThread(task => {
var dependencyStatus = task.Result;
if (dependencyStatus == Firebase.DependencyStatus.Available) {
// Create and hold a reference to your FirebaseApp,
// where app is a Firebase.FirebaseApp property of your application class.
app = Firebase.FirebaseApp.DefaultInstance;
IsInitCompleted = true; // you can use IsInitCompleted to determine if firebase initialization is complete in other modules
}
}); |
Hi, thanks for getting back to me. This is not about multiple parallel initialization. There was a case where the device does not have Google Play Services, so the Firebase Messaging does not work; failing the initialization. Authentication and Analytics should works when I do not use Firebase Messaging, but when I do, it actually fails the entire FirebaseApp and causes Authentication and Analytics to fail as well. I was wondering if there is a way to gracefully handle Firebase Messaging dependency failure, and still be able to use Authentication and Analytics. |
Well, if that's the case then there's no way, because Google Play services is a system app and you can't manipulate it from another app. |
Normally it will always be on unless turned off by the user. |
Some Android distros are without Play services apparently, like Kindle Fire. what I cannot understand here is that why can't I individually control what module to enable/initialize. If is is possible to do the dependency check/initialize each module individually, I should be able to use Authentication and Analytics even if Messaging is having dependency issue. |
FCM uses device tokens to uniquely identify devices for messaging, Google Play services manage these tokens, handling updates and synchronizations automatically. Besides Google Play services help authenticate devices and ensure secure communication between the Firebase backend and the app. Since it is based on the existing google play service system so what you want to modularize is not possible. In case of devices where google play service is not available you can try another 3rd party solution |
Hey thanks for answering long thread. I just wanted to make it clear, I have tested that it works with no problem when I only include Auth and Analytics packages. When I include Messaging, it fails the entire FirebaseApp. I want to be able to still use Auth and Analytics even if Messaging fails. Messaging is optional in terms of core business logic. So I wanted a way to pick which modules to check dependency/initialize. I want to avoid using FCM when there is no Google Play services installed on the device. |
Hi,
I have a Unity project using Firebase Auth, Analytics, Crashlytics along with Messaging. As far as I know Auth, Analytics, Crashlytics work without Google Play Services while it is required for Messaging. My app's core work without Messaging but requires Auth at the very least. I found a case where a device does not have Google Play Services and causing
Firebase.FirebaseApp.CheckAndFixDependenciesAsync()
to fail due to Messaging, and it actually disables other Firebase modules as well.Is there a way to initialize modules individually, so that the app can still operate without Messaging?
Thanks in advance,
Chi
The text was updated successfully, but these errors were encountered: