web-push-libs / webpush-java

Web Push library for Java
MIT License
318 stars 112 forks source link

Web push in Android WebView #142

Closed rrjanbiah closed 3 years ago

rrjanbiah commented 4 years ago

Apologies, if this is a wrong place or answered somewhere...

Since, Android WebView doesn't support web push yet, can this library be used to provide that feature?

martijndwars commented 3 years ago

Note that this library implements the server-side functionality, i.e. sending a push notification to the push service. This assumes that the browser (or Android WebView) has already created a push subscription first and has sent the subscription to the server. See Usage Example for an explanation of this flow.

As for Android WebView, this blog post by Marco Collin in 2018 mentions that Android WebView does not implement the Push API. Judging from this Chromium ticket that is still the case as I'm writing this. If your client cannot create a push subscription, then this library cannot help you either.

rrjanbiah commented 3 years ago

@MartijnDwars Thanks for the note