Fix cannot show push notification on android

(cherry picked from commit 07f1b44da20eddb412f36d982f2e08e0ca6d7f71)
This commit is contained in:
dab246
2023-03-30 16:12:21 +07:00
committed by Dat Vu
parent a7b5ac6b5c
commit 0c9d7ec4d3
@@ -88,6 +88,8 @@ class LocalNotificationManager {
final granted = await _isAndroidPermissionGranted(); final granted = await _isAndroidPermissionGranted();
if (!granted) { if (!granted) {
_notificationsEnabled = await _requestPermissions(); _notificationsEnabled = await _requestPermissions();
} else {
_notificationsEnabled = granted;
} }
} else { } else {
_notificationsEnabled = await _requestPermissions(); _notificationsEnabled = await _requestPermissions();
@@ -131,9 +133,6 @@ class LocalNotificationManager {
EmailAddress? emailAddress, EmailAddress? emailAddress,
String? payload String? payload
}) async { }) async {
if (!_notificationsEnabled) {
return;
}
final inboxStyleInformation = InboxStyleInformation( final inboxStyleInformation = InboxStyleInformation(
[message?.addBlockTag('p', attribute: 'style="color:#6D7885;"') ?? ''], [message?.addBlockTag('p', attribute: 'style="color:#6D7885;"') ?? ''],
htmlFormatLines: true, htmlFormatLines: true,