简体   繁体   English

每次更新网站时发送推送通知

[英]Send push-notification every time website is updated

I want to make an application that sends out a push-notification every time a website is updated with new content. 我想创建一个应用程序,每当用新内容更新网站时发出推送通知。 This website is updated 1-3 times every day. 本网站每天更新1-3次。 And it's contains a chronological feed, where each post had a datetime, video/image, title. 它包含一个按时间顺序排列的Feed,每个帖子都有一个日期时间,视频/图像,标题。

And I want the notification to contain this information, and link to the website(maybe via the app). 我希望通知包含此信息,并链接到网站(可能通过应用程序)。

Now what method should I use to get this app going? 现在我应该使用什么方法来使这个应用程序运行? How should I start, and proceed? 我应该如何开始,然后继续?

From your question's description, What I understood is this that you need to update your application whenever your website has new content. 从您的问题描述中,我理解的是,只要您的网站有新内容,您就需要更新您的应用程序。

This can be easily achieve using Remote/Push notification. 使用远程/推送通知可以轻松实现这一点。

You can use Boolean type or String type which can be understand by app and web. 您可以使用应用程序和Web可以理解的Boolean类型或String类型。

For example: 例如:

{
    "aps": {
        "alert": "Hello World",
        "sound": "default"
        "Content": {
                 "isNewContent": "1",          
        }  
    }
}

This is typical Custom notification object, you can send more details in that. 这是典型的自定义通知对象,您可以在其中发送更多详细信息。

Here you see that in Content there is a parameter isNewCotent which has a value 1 , this indicates that you have new content on web. 在这里,您可以看到在Content有一个参数isNewCotent ,其值为1 ,这表示您在Web上有新内容。

So now you can get call webservice to get new content from web server. 所以现在你可以调用webservice从Web服务器获取新内容。

And If you dont know that how to implement Push Notification in iOS, you can check below tutorial, explained in detail. 如果你不知道如何在iOS中实现推送通知,你可以查看下面的教程,详细解释。

Setting Up Push Notifications on iOS 在iOS上设置推送通知

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

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