firebase-android-sdk
firebase-android-sdk copied to clipboard
FirebaseMessaging : Disable retry Topic operation upon connection without internet
Our app users have reported an issue where the app is slow to start, sometimes taking around 1 minute to fully load. This problem occurs when their devices have no data left, even though mobile data is turned on. Interestingly, this issue does not happen when mobile data is turned off.
The app is built using Flutter. We suspect that this issue is caused by the Firebase Messaging SDK on Android, which assumes the connection will recover soon and thus runs a retry operation. This retry operation appears to occur after Firebase.initializeApp is called:
FirebaseApp firebaseApp = await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
);
The log message after opening the app is as follows:
Topic operation failed: SERVICE_NOT_AVAILABLE. Will retry Topic operation.
We want to disable the retry operation because we don't want the user to wait too long for the app to start. How can we achieve this?