diff --git a/example/lib/main.dart b/example/lib/main.dart index fa62878d..ff983fef 100644 --- a/example/lib/main.dart +++ b/example/lib/main.dart @@ -28,6 +28,7 @@ void main() async { showLocalNotification: (!kIsWeb && Platform.isAndroid) ? showLocalNotification : null, persistenceEnabled: true, + backgroundKeepAlive: Duration(seconds: 3), ); if (userId != null) { diff --git a/example/lib/notifications_service.dart b/example/lib/notifications_service.dart index c5b77c0e..83f5047a 100644 --- a/example/lib/notifications_service.dart +++ b/example/lib/notifications_service.dart @@ -33,7 +33,8 @@ void showLocalNotification(Message message, ChannelModel channel) async { } Future backgroundHandler(Map notification) async { - final messageId = notification['data']['message_id']; + print('new notification ${notification}'); + final messageId = notification['data']['id']; final notificationData = await NotificationService.getAndStoreMessage(messageId); diff --git a/example/pubspec.yaml b/example/pubspec.yaml index 80a852d8..5b025b4d 100644 --- a/example/pubspec.yaml +++ b/example/pubspec.yaml @@ -1,6 +1,6 @@ name: example description: A new Flutter project. -version: 1.0.83+85 +version: 1.0.84+86 environment: sdk: ">=2.2.2 <3.0.0"