@@ -3,7 +3,6 @@ import 'dart:typed_data';
33import 'dart:ui' ;
44import 'dart:convert' ;
55import 'dart:isolate' ;
6- import 'package:flutter/services.dart' ;
76import 'package:firebase_messaging/firebase_messaging.dart' ;
87import 'package:flutter_local_notifications/flutter_local_notifications.dart' ;
98import 'package:http/http.dart' as http;
@@ -288,8 +287,10 @@ Future<void> _onReceiveMessageFromPort(RemoteMessage firebaseMessage) async {
288287 );
289288}
290289
291- void _onSelectNotification (NotificationResponse details) {
292- final payload = details.payload;
290+ // The commented code is for when we will upgrade to flutter_local_notifications version 10
291+ void _onSelectNotification (String ? payload) {
292+ //void _onSelectNotification(NotificationResponse details) {
293+ // final payload = details.payload;
293294
294295 print ('📘 _onSelectNotification: $payload ' );
295296
@@ -320,11 +321,14 @@ Future<void> registerAndroidPushNotificationHandlers(AndroidChannel androidChann
320321 InitializationSettings (
321322 android: AndroidInitializationSettings ('@mipmap/ic_launcher' ),
322323 ),
323- onDidReceiveNotificationResponse: _onSelectNotification,
324+ // The commented code is for when we will upgrade to flutter_local_notifications version 10
325+ //onDidReceiveNotificationResponse: _onSelectNotification,
326+ onSelectNotification: _onSelectNotification,
324327 );
325328
326329 _androidChannel = androidChannel;
327330
331+ /* The commented code is for when we will upgrade to flutter_local_notifications version 10
328332 try {
329333 final activeNotifications = await _flutterLocalNotificationsPlugin
330334 .resolvePlatformSpecificImplementation<AndroidFlutterLocalNotificationsPlugin>()
@@ -357,6 +361,7 @@ Future<void> registerAndroidPushNotificationHandlers(AndroidChannel androidChann
357361 // PlatformException is raised on Android < 6.0
358362 // Simply ignoring this part
359363 }
364+ */
360365
361366 IsolateNameServer .registerPortWithName (_receivePort.sendPort, 'talkjsFCMPort' );
362367 _receivePort.listen ((message) async => await _onReceiveMessageFromPort (message));
0 commit comments