web app push notifications on native WKWebView

Hi, I'm required to create an app with a WkWebView, this web view should point to a webApp wich should send web notifications.

this web app, downloaded on the "home" of my device, is working. But from what I can see on the web, it is not possible for me having a native swift app, with a WkWebView , receiving notifications from the web app.

is it right? or there is a way to achieve this?

I understand that WkWebView view are not working with Service Workers which it seems to me they are required.

could someone help me? thanks in advance

Answered by Engineer in 797663022

Web Push Notifications will not work in apps with a WKWebView.

You can use native push notifications with an app that also happens to have a WKWebView, but not Web Push.

BTW, Service Workers work fine in a WKWebView. That is not the reason why Web Push is not working.


Argun Tekant /  DTS Engineer / Core Technologies

Accepted Answer

Web Push Notifications will not work in apps with a WKWebView.

You can use native push notifications with an app that also happens to have a WKWebView, but not Web Push.

BTW, Service Workers work fine in a WKWebView. That is not the reason why Web Push is not working.


Argun Tekant /  DTS Engineer / Core Technologies

Thank you Argun,

I need to explain why I cannot obtain "Android like" behavior to my team. Could you explain why "they won't work" in a "container" app with a WKWebView? Is it related to bundle id?

Thank you in advance.

I cannot discuss the whys of implementation details. The short answer is it does not work.

And why a feature in iOS does not work like it does on Android should not be difficult to answer.


Argun Tekant /  DTS Engineer / Core Technologies

web app push notifications on native WKWebView
 
 
Q