OneSignal-Website-SDK
OneSignal-Website-SDK copied to clipboard
Chrome Desktop with Dev iOS View - TypeError: Cannot read property 'pushNotification' of undefined
Description:
There is an js error when u are visiting following url = https://www.watson.ch/wirtschaft/schweiz/930659620-moebel-pfister-von-xxxlutz-gekauft-schweizer-tradition-geht-nach-oesterreich in mobile view
TypeError: Cannot read property 'pushNotification' of undefined
at Function.getSafariNotificationPermission (PermissionManager.js:83)
at Je.
Steps to Reproduce Issue:
- https://www.watson.ch/wirtschaft/schweiz/930659620-moebel-pfister-von-xxxlutz-gekauft-schweizer-tradition-geht-nach-oesterreich
- on mobile or with user-agent mobile on chrome developers mode
- check console output and u will find a js error
Anything else:
Thanx for your help in advance ;)
@watzak Thanks for reporting.
Issue Impact - Developer Environment
Only happens when selecting an iOS device (iPhone or iPad) in the Chrome Developer tools. Confirmed on a real iOS device in either the Chrome or Safari browser this error does not occur.
Issue - Details
Selecting an iOS device (iPhone or iPad) in the Chrome tools ends up mocking the navigator.userAgent
string to an iOS device, however it does not mock window.safari
so this error occurs in that testing environment.
Workaround
This is an error we will be fixing, in the meantime you can use "responsive" or an Android device in the drop down to simulate a non-iOS device to keep it from causing any issues in your mobile testing from a desktop browser.
Edit: this was fix in release 151600 on 2023/03/13
Is the issue solved? I have the same problem.
Hi, I'm getting the same issue for Chrome Canary / Win10. Are there at least any workarounds for this issue?
@weroh I updated my https://github.com/OneSignal/OneSignal-Website-SDK/issues/560#issuecomment-547127523 above. Let me know if that covers your question.
Its bug still actual.
@jkasten2 do you think this is ever gonna be fixed?
This is now fixed in the 151600 release that went out today.