Skip to content

Commit bf1f323

Browse files
committed
fix: add 5s timeout to getInitialMessage() to prevent splash freeze (WT-1061)
1 parent 5a006d1 commit bf1f323

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

lib/bootstrap.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,10 @@ Future<void> _initFirebaseMessaging() async {
237237
final appPush = AppRemotePush.fromFCM(message);
238238
RemotePushBroker.handleOpenedPush(appPush);
239239
});
240-
final initialMessage = await FirebaseMessaging.instance.getInitialMessage();
240+
final initialMessage = await FirebaseMessaging.instance.getInitialMessage().timeout(
241+
const Duration(seconds: 5),
242+
onTimeout: () => null,
243+
);
241244
if (initialMessage != null) {
242245
logger.info('initialMessage: ${initialMessage.toMap()}');
243246
final appPush = AppRemotePush.fromFCM(initialMessage);

0 commit comments

Comments
 (0)