bugfixes, better background operation robustness and platform-specific error handling
This commit is contained in:
+12
-3
@@ -121,10 +121,19 @@ Future<void> main() async {
|
||||
),
|
||||
);
|
||||
|
||||
// Diagnostic log only. getToken() can fail transiently during cold start
|
||||
// (Android: "IOException: FCM Registration failed!" from Play Services,
|
||||
// iOS: apns-token-not-set until APNS registration completes), so tolerate
|
||||
// the failure instead of letting it surface as an uncaught async error that
|
||||
// gets reported to the telemetry backend as noise.
|
||||
unawaited(
|
||||
FirebaseMessaging.instance.getToken().then(
|
||||
(token) => log('Firebase token: ${token ?? "Error: no Firebase token!"}'),
|
||||
),
|
||||
FirebaseMessaging.instance
|
||||
.getToken()
|
||||
.then(
|
||||
(token) =>
|
||||
log('Firebase token: ${token ?? "Error: no Firebase token!"}'),
|
||||
)
|
||||
.onError((e, _) => log('Firebase token unavailable: $e')),
|
||||
);
|
||||
|
||||
// Warm up the Nextcloud root listing in the background while the user is
|
||||
|
||||
Reference in New Issue
Block a user