OneSignal-Website-SDK icon indicating copy to clipboard operation
OneSignal-Website-SDK copied to clipboard

Chrome Desktop with Dev iOS View - TypeError: Cannot read property 'pushNotification' of undefined

Open watzak opened this issue 4 years ago • 6 comments

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. (PermissionManager.js:69) at Generator.next () at SubscriptionError.js:3 at new Promise () at Ye (SubscriptionError.js:3) at Je.getReportedNotificationPermission (PermissionManager.js:67) at Je. (PermissionManager.js:39) at Generator.next () at SubscriptionError.js:3

Steps to Reproduce Issue:

  1. https://www.watson.ch/wirtschaft/schweiz/930659620-moebel-pfister-von-xxxlutz-gekauft-schweizer-tradition-geht-nach-oesterreich
  2. on mobile or with user-agent mobile on chrome developers mode
  3. check console output and u will find a js error

Anything else:

Thanx for your help in advance ;)

watzak avatar Oct 23 '19 12:10 watzak

@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

jkasten2 avatar Oct 28 '19 20:10 jkasten2

Is the issue solved? I have the same problem.

BasileusGR avatar Jan 25 '21 13:01 BasileusGR

Hi, I'm getting the same issue for Chrome Canary / Win10. Are there at least any workarounds for this issue?

weroh avatar Feb 26 '21 23:02 weroh

@weroh I updated my https://github.com/OneSignal/OneSignal-Website-SDK/issues/560#issuecomment-547127523 above. Let me know if that covers your question.

jkasten2 avatar Mar 01 '21 07:03 jkasten2

Its bug still actual.

ghost avatar Jul 19 '21 09:07 ghost

@jkasten2 do you think this is ever gonna be fixed?

bfischer1121 avatar Jan 26 '22 04:01 bfischer1121

This is now fixed in the 151600 release that went out today.

jkasten2 avatar Mar 13 '23 23:03 jkasten2