From 4b434e583eb56799d3f476aa5da879491bfb9055 Mon Sep 17 00:00:00 2001 From: MinhDV Date: Wed, 4 Oct 2023 16:38:44 +0700 Subject: [PATCH] TW-726 Notification android --- lib/utils/background_push.dart | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/utils/background_push.dart b/lib/utils/background_push.dart index 4f41479eee..1ab50d99ba 100644 --- a/lib/utils/background_push.dart +++ b/lib/utils/background_push.dart @@ -281,6 +281,11 @@ class BackgroundPush { if (PlatformInfos.isIOS) { // Request iOS permission before getting the token await fcmSharedIsolate?.requestPermission(); + } else if (Platform.isAndroid) { + await _flutterLocalNotificationsPlugin + .resolvePlatformSpecificImplementation< + AndroidFlutterLocalNotificationsPlugin>() + ?.requestPermission(); } _pushToken = await (Platform.isIOS ? apnChannel.invokeMethod("getToken")