fix: Request notification permissions on iOS before getToken

pull/733/head
Krille 1 week ago
parent 039771ee5e
commit 69711506ea
No known key found for this signature in database
GPG Key ID: E067ECD60F1A0652

@ -72,6 +72,9 @@ class BackgroundPush {
void _init() async {
try {
if (PlatformInfos.isIOS) {
await firebase?.requestPermission();
}
await _flutterLocalNotificationsPlugin.initialize(
const InitializationSettings(
android: AndroidInitializationSettings('notifications_icon'),
@ -147,9 +150,7 @@ class BackgroundPush {
Set<String?>? oldTokens,
bool useDeviceSpecificAppId = false,
}) async {
if (PlatformInfos.isIOS) {
await firebase?.requestPermission();
} else if (PlatformInfos.isAndroid) {
if (PlatformInfos.isAndroid) {
_flutterLocalNotificationsPlugin
.resolvePlatformSpecificImplementation<
AndroidFlutterLocalNotificationsPlugin>()

Loading…
Cancel
Save