From 1a723656feecd09098759588c3400de1a24cb09d Mon Sep 17 00:00:00 2001 From: Emre Date: Thu, 3 Aug 2023 12:58:38 +0200 Subject: [PATCH] Add Key Serveur and test work --- Sources/justMUSIC/lib/services/NotificationService.dart | 3 ++- Sources/justMUSIC/test/Notification_test.dart | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 Sources/justMUSIC/test/Notification_test.dart diff --git a/Sources/justMUSIC/lib/services/NotificationService.dart b/Sources/justMUSIC/lib/services/NotificationService.dart index e37f2b3..9f583b7 100644 --- a/Sources/justMUSIC/lib/services/NotificationService.dart +++ b/Sources/justMUSIC/lib/services/NotificationService.dart @@ -7,7 +7,8 @@ class NotificationService { await http.post(Uri.parse('https://fcm.googleapis.com/fcm/send'), headers: { 'Content-Type': 'application/json', - 'Authorization': 'key=' + 'Authorization': + 'key=AAAA56TmIPg:APA91bFeKMr_i6CbUuuUdFI1XkdaNE2A7OVHzxrPIsOSlDfhR6qzZwof7JNGxthWUKj1dRHQMheWNYaLbf3AtXUp9o4DX_gB2073yR4urqUEh9CjvnxVws_9g1cWMgmFS3EpaQEA3icC' }, body: jsonEncode({ 'priority': 'high', diff --git a/Sources/justMUSIC/test/Notification_test.dart b/Sources/justMUSIC/test/Notification_test.dart new file mode 100644 index 0000000..bf9f23c --- /dev/null +++ b/Sources/justMUSIC/test/Notification_test.dart @@ -0,0 +1,6 @@ +import 'package:justmusic/services/NotificationService.dart'; + +Future main() async { + var notif = NotificationService(); + await notif.sendPushMessage("cAJAJw_aR7yPQbFTMS-r6H:APA91bEZs34Ab3-xSYeIGykHrxD5pRj-OyODaEcNBPtds1eLzEH0uzFkzCSQY7BvZQHEFPfeHSN7nri4webskXbu1zzgwe9NIdPagsc6IHaouuewWqWd9V7ucTeDeYt1Sbby4-pb6jtA", "Just Music", "Vien voir les nouveautés"); +} \ No newline at end of file