[英]How to send personalized push notification when using webview in android?
I am loading my website using webview using android studio. 我正在使用android studio的webview加载我的网站。 I am able to send bulk push notification, but not able to figure out approach to send personalized push notification like any social app. 我能够发送批量推送通知,但无法找到像任何社交应用一样发送个性化推送通知的方法。 Please help me in the same. 请同样帮我。
Thanks 谢谢
If you are using Firebase Cloud Message to send/receive messages, you can control the notification that users see. 如果您使用Firebase Cloud Message发送/接收消息,则可以控制用户看到的通知。 You do this by overriding the "onMessageReceived" method and implementing whatever logic you want to show a notification on the user's device. 为此,您可以重写“ onMessageReceived”方法,并实现希望在用户设备上显示通知的任何逻辑。
See the documentation for more information: Override onMessageReceived - Firebase Cloud Message 有关更多信息,请参阅文档: 覆盖onMessageReceived-Firebase Cloud Message
If you are using your WebView as a WebApp, Service Worker support in chrome webview does exist for Android 5.0+ with a updated System WebView. 如果您将WebView用作WebApp,则对于带有更新的System WebView的Android 5.0及更高版本, Chrome Webview中确实存在Service Worker支持 。
As mentioned in the link, each WebView is in its own sandbox so you would need to handle login each time the app is restarted. 如链接中所述,每个WebView都位于其自己的沙箱中,因此,每次重新启动应用程序时,您都需要处理登录。 Alternatively use Chrome Custom Tabs instead as it allows for: 或者,也可以使用Chrome自定义标签,因为它允许:
Shared cookie jar and permissions model so users don't have to log in to sites they are already connected to, or re-grant permissions they have already granted. 共享的cookie jar和权限模型,因此用户不必登录到他们已经连接的站点,也不必重新授予他们已经授予的权限。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.