Not able to receive push notification when WebApp is active, Am I missing something ?
I'm not able to receive notification when tab is active or when I'm on another tab. I'm getting notification only if my tab/website is completely closed. I'm facing same in my PWA as well. When PWA app and website is closed I'm able to receive notification. Am I missing anything ?
const isPushNotificationSupported = oneSignalApp.Notifications.isPushSupported()
await oneSignalApp.Notifications.requestPermission()
if (
isPushNotificationSupported &&
oneSignalApp.Notifications.permission &&
oneSignalApp.Notifications.permissionNative === 'granted'
) {
/// Here goes my code to save player_id in backend
}
Not able to receive push notification when WebApp is active, Am I missing something ?
I'm not able to receive notification when tab is active or when I'm on another tab. I'm getting notification only if my tab/website is completely closed. I'm facing same in my PWA as well. When PWA app and website is closed I'm able to receive notification. Am I missing anything ?
main.js
My one-signal composable
Package versions
"@onesignal/onesignal-vue3": "^2.0.1", "vue": "^3.3.11"
Service worker
/public/OneSignalSDKWorker.js -> importScripts("https://cdn.onesignal.com/sdks/web/v16/OneSignalSDK.sw.js");
Any help would be really appreciated. Thanks