简体   繁体   English

如何在 webview 中添加通知?

[英]How to add notification in webview?

I have created a webview app which working is perfectly fine with a website say xyz.com我创建了一个 webview 应用程序,它与一个网站说 xyz.com 工作得非常好

The app is made for small scale purpose and for personal use.该应用程序是为小规模目的和个人使用而制作的。 (Not uploaded in play store) (不在Play商店上传)

Generally when I change some content in the website - Index.html(say) the app also gets update as it loads the updated url.通常,当我更改网站中的某些内容时 - Index.html(say) 应用程序也会在加载更新后的 url 时得到更新。

I want to create a notification that whenever I change the content user gets a notification in their notification bar say (today event - abc ) and when they click that notification it opens the app to see what got updated.我想创建一个通知,每当我更改内容时,用户都会在他们的通知栏中收到通知(今天事件 - abc),当他们单击该通知时,它会打开应用程序以查看更新的内容。

How to create such notifications?如何创建此类通知?

You need to first register your user and get the gcm registration id and save it on your server.您需要先注册您的用户并获取 gcm 注册 ID 并将其保存在您的服务器上。 Then you can implement notification system present in android like this http://developer.android.com/guide/topics/ui/notifiers/notifications.html Whenever you change your content just send a notification to all the user base and your work is done.然后你可以像这样在 android 中实现通知系统http://developer.android.com/guide/topics/ui/notifiers/notifications.html每当你更改内容时,只需向所有用户群发送通知,你的工作就是完毕。 Thanks谢谢

You can add bootstrap modal in index.html page.您可以在 index.html 页面中添加引导模式。 and add content on that model并在该模型上添加内容

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM