fix
This commit is contained in:
@@ -43,9 +43,15 @@ export function NotificationProvider() {
|
||||
let unsubscribe: (() => void) | null = null;
|
||||
|
||||
const init = async () => {
|
||||
console.log('[NotificationProvider] Initializing push notifications...');
|
||||
const registered = await notificationService.requestPermissionAndRegister();
|
||||
console.log('[NotificationProvider] Registration result:', registered);
|
||||
if (registered) {
|
||||
unsubscribe = notificationService.setupForegroundHandler(addToast);
|
||||
unsubscribe = notificationService.setupForegroundHandler((payload) => {
|
||||
console.log('[NotificationProvider] Foreground message received:', payload);
|
||||
addToast(payload);
|
||||
});
|
||||
console.log('[NotificationProvider] Foreground handler set up');
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user