1

Hello I have an application with several webviews. I would like to intercept web notifications and print them in the console.

I have already written JavaScript code to intercept web notifications and print them.

The problem is that I feel that we can not enable web notifications in a WKWebView. When I inject window.Notification.permission i always get default or denied. I would like to get granted, how can I grant permission to enable the webview?

I just need to know how to allow window.Notification because all the rest of my code is ready, that is the only thing I miss.

I know that with UIWebView it is possible but deprecated so I do not want to use it. For UIWebview there is a private API WebNotificationProvider, is there an equivalent for WKWebView?

I've been looking for a few weeks and can not find a solution.

p13n
  • 859
  • 8
  • 31

0 Answers0