File tree 1 file changed +3
-6
lines changed
1 file changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -72,9 +72,6 @@ class BackgroundPush {
72
72
73
73
void _init () async {
74
74
try {
75
- if (PlatformInfos .isIOS) {
76
- await firebase? .requestPermission ();
77
- }
78
75
await _flutterLocalNotificationsPlugin.initialize (
79
76
const InitializationSettings (
80
77
android: AndroidInitializationSettings ('notifications_icon' ),
@@ -150,6 +147,9 @@ class BackgroundPush {
150
147
Set <String ?>? oldTokens,
151
148
bool useDeviceSpecificAppId = false ,
152
149
}) async {
150
+ if (PlatformInfos .isIOS) {
151
+ await firebase? .requestPermission ();
152
+ }
153
153
if (PlatformInfos .isAndroid) {
154
154
_flutterLocalNotificationsPlugin
155
155
.resolvePlatformSpecificImplementation<
@@ -306,9 +306,6 @@ class BackgroundPush {
306
306
Logs ().v ('Setup firebase' );
307
307
if (_fcmToken? .isEmpty ?? true ) {
308
308
try {
309
- if (PlatformInfos .isIOS) {
310
- await firebase? .requestPermission ();
311
- }
312
309
_fcmToken = await firebase? .getToken ();
313
310
if (_fcmToken == null ) throw ('PushToken is null' );
314
311
} catch (e, s) {
You can’t perform that action at this time.
0 commit comments