Push token push (to server)

This commit is contained in:
2024-11-21 22:55:00 +08:00
parent d41e358c6a
commit 7e63611416
6 changed files with 37 additions and 14 deletions

View File

@ -19,6 +19,13 @@ class NotificationProvider extends ChangeNotifier {
_sn = context.read<SnNetworkProvider>();
_ua = context.read<UserProvider>();
_ws = context.read<WebSocketProvider>();
// Delay to wait user provider ready to use
Future.delayed(const Duration(milliseconds: 3000), () async {
if (!_ua.isAuthorized) return;
log("Registering push notifications...");
await registerPushNotifications();
});
}
Future<void> registerPushNotifications() async {