You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I am integrating a simple OneSignal setup to use Android and iOs PWA Push Notifications using the custom code approach.
When I send Notifications manually then the notification is shown correctly, but the launch URL parameter is being ignored on iOs, Android works correctly.
The current setup looks like this:
We also use a minimal Workbox Service Worker setup for a positive Offline response and integrate it in the OneSignalSDKWorker.js file:
window.addEventListener("load",()=>{if("serviceWorker"innavigator){navigator.serviceWorker.register("/OneSignalSDKWorker.js").catch((error)=>{console.warn("Error registering service worker:");console.warn(error);});}});// Wait for domloadedwindow.addEventListener("DOMContentLoaded",()=>{// Check if the app runs in installed mode, or at least not in default browser modeif(!window.matchMedia("(display-mode: browser)").matches){window.OneSignal=window.OneSignal||[];OneSignal.push(function(){OneSignal.init({appId: "...",safari_web_id: "...",welcomeNotification: {title: "Some Title",message: "Some message",},promptOptions: {slidedown: {prompts: [{type: "push",autoPrompt: true,text: {actionMessage: "Some Message",acceptButton: "yes",cancelButton: "no",},delay: {pageViews: 1,timeDelay: 10,},},],},},});});}});
Is the setup wrong or is it currently not supposed to be possible to open an URL in an installed iOs PWA?
Thank you for your feedback.
The text was updated successfully, but these errors were encountered:
Would it be possible to workaround the issue with Event Listeners or something similar? The ones I've identified so far in Web SDK are marked to not work on safari.
Or should the feature work but my setup is messed up, thank you for your time.
I got around this using Event listeners for the 'notificationClicked' event from memory and it works in Safari as well as the other browsers. Have you tried this yet?
How can we help?
Hi, I am integrating a simple OneSignal setup to use Android and iOs PWA Push Notifications using the custom code approach.
When I send Notifications manually then the notification is shown correctly, but the launch URL parameter is being ignored on iOs, Android works correctly.
The current setup looks like this:
OneSignalSDKWorker.js
file:OneSignal.init
looks like this:Is the setup wrong or is it currently not supposed to be possible to open an URL in an installed iOs PWA?
Thank you for your feedback.
The text was updated successfully, but these errors were encountered: