简体   繁体   English

在Android中使用WebView时如何发送个性化推送通知?

[英]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.

相关问题 如何使用php向Android发送推送通知 - How to send push notification by using php to android 如何在android中使用thirdparty push woosh发送推送通知 - How to send push notification using thirdparty push woosh in android Android WebView 推送通知? - Android WebView push notification? 当用户发布消息时,如何发送推送通知(解析) - How to send a push Notification (Parse) When a user publish a message Android 当接收方设备未在Android中使用FCM处于前台状态时,如何从设备发送推送通知? - How to send Push Notification from device when the receiver device is not in foreground state using FCM in android? 如何在 Android 中取消推送通知时发送请求 - How to send a request when push notification is cancelled in Android 即使应用程序被杀死,如何向Android设备发送推送通知? - How to send push notification to android devices even when app is killed? 如何在Android中使用Pushwoosh发送自动推送通知 - How to send automated Push notification using Pushwoosh in android 如何使用FCM向我数据库中的用户发送推送通知? 安卓 - How to send a push notification to a user that is in my database using FCM? android 如何使用GCM在Android中发送大小图像作为推送通知 - How to send small and large image as a push notification in android using GCM
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM