Answer the question
In order to leave comments, you need to log in
Android webview app access to notifications?
I have a music site for which I wrote a WebView application.
Essence of the question: How to allow the site to display notifications in the blind and on the lock screen. (works in Chrome and Firefox).
And most importantly, when you switch to another application, the music continues to play. (On a locked device, it sings, but stops when switching.)
Answer the question
In order to leave comments, you need to log in
Most likely, it will not work through webView or how to display notifications, since webView is essentially a browser, and if third-party sites could show notifications (etc), i.e. run some kind of code, then this would be a vulnerability. But this is not accurate.
That is, to implement something like this, you will need to write native code.
I use Appcelerator Titanium for cross-platform applications
where you can connect WebView and "external application" content via eventListeners,
docs.appcelerator.com/platform/latest/#!/api/Titan...
I don’t know what you packed, but you can try Titanium. You need to put only 1 component and put the html file in assets
1 to keep singing while switching. application, I would try to move the webview to the service, and the service would visit foreground
2 in the webview, you can inject java code and call it from the page, so you can throw any notifications in the blind, but with the application running,
otherwise the push notification will not start
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question