Skip to content

Commit 94837ee

Browse files
author
Franco Bugnano
committed
Continued work on push notifications on Android
1 parent 75fe3f1 commit 94837ee

File tree

6 files changed

+417
-108
lines changed

6 files changed

+417
-108
lines changed

examples/push_notifications/lib/main.dart

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,21 @@
11
import 'package:flutter/material.dart';
22
import 'package:talkjs_flutter/talkjs_flutter.dart';
3+
import 'package:firebase_core/firebase_core.dart';
34
import 'firebase_options.dart';
45

5-
void main() {
6+
Future<void> main() async {
7+
WidgetsFlutterBinding.ensureInitialized();
8+
await Firebase.initializeApp(
9+
options: DefaultFirebaseOptions.currentPlatform,
10+
);
11+
12+
await registerPushNotificationHandlers(
13+
androidChannel: const AndroidChannel(
14+
channelId: 'com.talkjs.flutter_push_example.messages',
15+
channelName: 'Messages',
16+
),
17+
);
18+
619
runApp(const MyApp());
720
}
821

@@ -12,14 +25,6 @@ class MyApp extends StatelessWidget {
1225
// This widget is the root of your application.
1326
@override
1427
Widget build(BuildContext context) {
15-
registerPushNotificationHandlers(
16-
currentPlatform: DefaultFirebaseOptions.currentPlatform,
17-
androidChannel: const AndroidChannel(
18-
channelId: 'com.talkjs.flutter_push_example.messages',
19-
channelName: 'Messages',
20-
),
21-
);
22-
2328
//final session = Session(appId: 'Hku1c4Pt');
2429
final session = Session(appId: 'tuM9UrY8'); // For local testing
2530

examples/push_notifications/pubspec.lock

Lines changed: 117 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
# Generated by pub
22
# See https://dart.dev/tools/pub/glossary#lockfile
33
packages:
4+
args:
5+
dependency: transitive
6+
description:
7+
name: args
8+
url: "https://pub.dartlang.org"
9+
source: hosted
10+
version: "2.3.0"
411
async:
512
dependency: transitive
613
description:
@@ -42,7 +49,7 @@ packages:
4249
name: collection
4350
url: "https://pub.dartlang.org"
4451
source: hosted
45-
version: "1.15.0"
52+
version: "1.16.0"
4653
crypto:
4754
dependency: transitive
4855
description:
@@ -57,13 +64,34 @@ packages:
5764
url: "https://pub.dartlang.org"
5865
source: hosted
5966
version: "1.0.4"
67+
dbus:
68+
dependency: transitive
69+
description:
70+
name: dbus
71+
url: "https://pub.dartlang.org"
72+
source: hosted
73+
version: "0.7.3"
6074
fake_async:
6175
dependency: transitive
6276
description:
6377
name: fake_async
6478
url: "https://pub.dartlang.org"
6579
source: hosted
66-
version: "1.2.0"
80+
version: "1.3.0"
81+
ffi:
82+
dependency: transitive
83+
description:
84+
name: ffi
85+
url: "https://pub.dartlang.org"
86+
source: hosted
87+
version: "1.1.2"
88+
file:
89+
dependency: transitive
90+
description:
91+
name: file
92+
url: "https://pub.dartlang.org"
93+
source: hosted
94+
version: "6.1.2"
6795
firebase_core:
6896
dependency: "direct main"
6997
description:
@@ -118,6 +146,27 @@ packages:
118146
url: "https://pub.dartlang.org"
119147
source: hosted
120148
version: "1.0.4"
149+
flutter_local_notifications:
150+
dependency: transitive
151+
description:
152+
name: flutter_local_notifications
153+
url: "https://pub.dartlang.org"
154+
source: hosted
155+
version: "9.5.2"
156+
flutter_local_notifications_linux:
157+
dependency: transitive
158+
description:
159+
name: flutter_local_notifications_linux
160+
url: "https://pub.dartlang.org"
161+
source: hosted
162+
version: "0.4.2"
163+
flutter_local_notifications_platform_interface:
164+
dependency: transitive
165+
description:
166+
name: flutter_local_notifications_platform_interface
167+
url: "https://pub.dartlang.org"
168+
source: hosted
169+
version: "5.0.0"
121170
flutter_test:
122171
dependency: "direct dev"
123172
description: flutter
@@ -128,13 +177,27 @@ packages:
128177
description: flutter
129178
source: sdk
130179
version: "0.0.0"
180+
http:
181+
dependency: transitive
182+
description:
183+
name: http
184+
url: "https://pub.dartlang.org"
185+
source: hosted
186+
version: "0.13.4"
187+
http_parser:
188+
dependency: transitive
189+
description:
190+
name: http_parser
191+
url: "https://pub.dartlang.org"
192+
source: hosted
193+
version: "4.0.0"
131194
js:
132195
dependency: transitive
133196
description:
134197
name: js
135198
url: "https://pub.dartlang.org"
136199
source: hosted
137-
version: "0.6.3"
200+
version: "0.6.4"
138201
lints:
139202
dependency: transitive
140203
description:
@@ -155,7 +218,7 @@ packages:
155218
name: material_color_utilities
156219
url: "https://pub.dartlang.org"
157220
source: hosted
158-
version: "0.1.3"
221+
version: "0.1.4"
159222
meta:
160223
dependency: transitive
161224
description:
@@ -169,14 +232,35 @@ packages:
169232
name: path
170233
url: "https://pub.dartlang.org"
171234
source: hosted
172-
version: "1.8.0"
235+
version: "1.8.1"
236+
petitparser:
237+
dependency: transitive
238+
description:
239+
name: petitparser
240+
url: "https://pub.dartlang.org"
241+
source: hosted
242+
version: "4.4.0"
243+
platform:
244+
dependency: transitive
245+
description:
246+
name: platform
247+
url: "https://pub.dartlang.org"
248+
source: hosted
249+
version: "3.1.0"
173250
plugin_platform_interface:
174251
dependency: transitive
175252
description:
176253
name: plugin_platform_interface
177254
url: "https://pub.dartlang.org"
178255
source: hosted
179256
version: "2.1.2"
257+
process:
258+
dependency: transitive
259+
description:
260+
name: process
261+
url: "https://pub.dartlang.org"
262+
source: hosted
263+
version: "4.2.4"
180264
sky_engine:
181265
dependency: transitive
182266
description: flutter
@@ -188,7 +272,7 @@ packages:
188272
name: source_span
189273
url: "https://pub.dartlang.org"
190274
source: hosted
191-
version: "1.8.1"
275+
version: "1.8.2"
192276
stack_trace:
193277
dependency: transitive
194278
description:
@@ -230,7 +314,14 @@ packages:
230314
name: test_api
231315
url: "https://pub.dartlang.org"
232316
source: hosted
233-
version: "0.4.8"
317+
version: "0.4.9"
318+
timezone:
319+
dependency: transitive
320+
description:
321+
name: timezone
322+
url: "https://pub.dartlang.org"
323+
source: hosted
324+
version: "0.8.0"
234325
typed_data:
235326
dependency: transitive
236327
description:
@@ -244,21 +335,21 @@ packages:
244335
name: vector_math
245336
url: "https://pub.dartlang.org"
246337
source: hosted
247-
version: "2.1.1"
338+
version: "2.1.2"
248339
webview_flutter:
249340
dependency: transitive
250341
description:
251342
name: webview_flutter
252343
url: "https://pub.dartlang.org"
253344
source: hosted
254-
version: "3.0.2"
345+
version: "3.0.3"
255346
webview_flutter_android:
256347
dependency: transitive
257348
description:
258349
name: webview_flutter_android
259350
url: "https://pub.dartlang.org"
260351
source: hosted
261-
version: "2.8.6"
352+
version: "2.8.7"
262353
webview_flutter_platform_interface:
263354
dependency: transitive
264355
description:
@@ -272,7 +363,21 @@ packages:
272363
name: webview_flutter_wkwebview
273364
url: "https://pub.dartlang.org"
274365
source: hosted
275-
version: "2.7.3"
366+
version: "2.7.4"
367+
xdg_directories:
368+
dependency: transitive
369+
description:
370+
name: xdg_directories
371+
url: "https://pub.dartlang.org"
372+
source: hosted
373+
version: "0.2.0+1"
374+
xml:
375+
dependency: transitive
376+
description:
377+
name: xml
378+
url: "https://pub.dartlang.org"
379+
source: hosted
380+
version: "5.3.1"
276381
sdks:
277-
dart: ">=2.16.2 <3.0.0"
382+
dart: ">=2.17.0-0 <3.0.0"
278383
flutter: ">=2.8.1"

0 commit comments

Comments
 (0)