chore: Follow up notification action isolate handling
This commit is contained in:
parent
b7e112a224
commit
3c049211ca
3 changed files with 27 additions and 3 deletions
|
|
@ -1,6 +1,8 @@
|
|||
import 'dart:isolate';
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:fluffychat/config/app_config.dart';
|
||||
import 'package:fluffychat/utils/notification_background_handler.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:collection/collection.dart';
|
||||
|
|
@ -20,11 +22,12 @@ ReceivePort? mainIsolateReceivePort;
|
|||
void main() async {
|
||||
if (PlatformInfos.isAndroid) {
|
||||
final port = mainIsolateReceivePort = ReceivePort();
|
||||
IsolateNameServer.removePortNameMapping('main_isolate');
|
||||
IsolateNameServer.removePortNameMapping(AppConfig.mainIsolatePortName);
|
||||
IsolateNameServer.registerPortWithName(
|
||||
port.sendPort,
|
||||
'main_isolate',
|
||||
AppConfig.mainIsolatePortName,
|
||||
);
|
||||
await waitForPushIsolateDone();
|
||||
}
|
||||
|
||||
// Our background push shared isolate accesses flutter-internal things very early in the startup proccess
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue