fix: Request notification permission on android

pull/855/merge rc1.17.3-2
Krille 1 year ago
parent 565270757d
commit 6cc2c6a578
No known key found for this signature in database
GPG Key ID: E067ECD60F1A0652

@ -139,6 +139,11 @@ class BackgroundPush {
}) async {
if (PlatformInfos.isIOS) {
await firebase?.requestPermission();
} else if (PlatformInfos.isAndroid) {
_flutterLocalNotificationsPlugin
.resolvePlatformSpecificImplementation<
AndroidFlutterLocalNotificationsPlugin>()
?.requestNotificationsPermission();
}
final clientName = PlatformInfos.clientName;
oldTokens ??= <String>{};

@ -61,6 +61,7 @@ Future<void> pushHelper(
ticker: l10n.unreadChats(notification.counts?.unread ?? 1),
importance: Importance.max,
priority: Priority.max,
shortcutId: notification.roomId,
fullScreenIntent: true, // To show notification popup
),
),
@ -233,6 +234,7 @@ Future<void> _tryPushHelper(
channelDescription: groupName,
number: notification.counts?.unread,
category: AndroidNotificationCategory.message,
shortcutId: event.room.id,
styleInformation: messagingStyleInformation ??
MessagingStyleInformation(
person,

Loading…
Cancel
Save