From 63499df99f5b1dbcd79d92cf71d6d2376d4fb457 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Sat, 23 Nov 2024 12:52:13 +0800 Subject: [PATCH] :bug: Bug fixes on notification push token register --- lib/providers/notification.dart | 3 ++- lib/widgets/chat/chat_message_input.dart | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/providers/notification.dart b/lib/providers/notification.dart index 8475618..f4b151c 100644 --- a/lib/providers/notification.dart +++ b/lib/providers/notification.dart @@ -25,6 +25,7 @@ class NotificationProvider extends ChangeNotifier { if (!_ua.isAuthorized) return; log("Registering push notifications..."); await registerPushNotifications(); + log("Registered push notification subscriber successfully!"); }); } @@ -54,7 +55,7 @@ class NotificationProvider extends ChangeNotifier { log('Device Push Token is $token'); await _sn.client.post( - '/cgi/id/notifications/subscribe', + '/cgi/id/notifications/subscription', data: { 'provider': provider, 'device_token': token, diff --git a/lib/widgets/chat/chat_message_input.dart b/lib/widgets/chat/chat_message_input.dart index 04c7301..d372a08 100644 --- a/lib/widgets/chat/chat_message_input.dart +++ b/lib/widgets/chat/chat_message_input.dart @@ -275,6 +275,8 @@ class ChatMessageInputState extends State { ]), border: InputBorder.none, ), + onTapOutside: (_) => + FocusManager.instance.primaryFocus?.unfocus(), onSubmitted: (_) { if (_isBusy) return; _sendMessage();