Skip to content

Commit 07ca817

Browse files
authored
Merge pull request #12 from talkjs/fix/no-prerelease
Revert to non-prerelease version of flutter_local_notifications
2 parents c15d587 + e42640b commit 07ca817

File tree

5 files changed

+18
-12
lines changed

5 files changed

+18
-12
lines changed

example/push_notifications/lib/main.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import 'dart:io' show Platform;
12
import 'package:flutter/material.dart';
23
import 'package:talkjs_flutter/talkjs_flutter.dart';
34
import 'package:firebase_core/firebase_core.dart';

example/push_notifications/pubspec.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,21 +159,21 @@ packages:
159159
name: flutter_local_notifications
160160
url: "https://pub.dartlang.org"
161161
source: hosted
162-
version: "10.0.0-dev.14"
162+
version: "9.6.0"
163163
flutter_local_notifications_linux:
164164
dependency: transitive
165165
description:
166166
name: flutter_local_notifications_linux
167167
url: "https://pub.dartlang.org"
168168
source: hosted
169-
version: "0.5.0-dev.4"
169+
version: "0.5.0+1"
170170
flutter_local_notifications_platform_interface:
171171
dependency: transitive
172172
description:
173173
name: flutter_local_notifications_platform_interface
174174
url: "https://pub.dartlang.org"
175175
source: hosted
176-
version: "6.0.0-dev.4"
176+
version: "5.0.0"
177177
flutter_test:
178178
dependency: "direct dev"
179179
description: flutter
@@ -307,7 +307,7 @@ packages:
307307
path: "../.."
308308
relative: true
309309
source: path
310-
version: "0.2.1"
310+
version: "0.3.0"
311311
talkjs_webview_flutter:
312312
dependency: transitive
313313
description:

lib/src/notification.dart

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import 'dart:typed_data';
33
import 'dart:ui';
44
import 'dart:convert';
55
import 'dart:isolate';
6-
import 'package:flutter/services.dart';
76
import 'package:firebase_messaging/firebase_messaging.dart';
87
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
98
import '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));

pubspec.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,21 +145,21 @@ packages:
145145
name: flutter_local_notifications
146146
url: "https://pub.dartlang.org"
147147
source: hosted
148-
version: "10.0.0-dev.14"
148+
version: "9.6.0"
149149
flutter_local_notifications_linux:
150150
dependency: transitive
151151
description:
152152
name: flutter_local_notifications_linux
153153
url: "https://pub.dartlang.org"
154154
source: hosted
155-
version: "0.5.0-dev.4"
155+
version: "0.5.0+1"
156156
flutter_local_notifications_platform_interface:
157157
dependency: transitive
158158
description:
159159
name: flutter_local_notifications_platform_interface
160160
url: "https://pub.dartlang.org"
161161
source: hosted
162-
version: "6.0.0-dev.4"
162+
version: "5.0.0"
163163
flutter_test:
164164
dependency: "direct dev"
165165
description: flutter

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ dependencies:
1515
crypto: ^3.0.1
1616
firebase_core: ^1.16.0
1717
firebase_messaging: ^11.3.0
18-
flutter_local_notifications: ^10.0.0-dev.14
18+
flutter_local_notifications: ^9.6.0
1919
http: ^0.13.4
2020
flutter_apns_only: ^1.5.2
2121

0 commit comments

Comments
 (0)