实施预定的推送通知的最佳方法 [英] Best way to implement scheduled push notifications

本文介绍了实施预定的推送通知的最佳方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在开发一款具有某种用户会议系统的应用,最近,我们的产品团队要求包含一些预定的推送通知,这些通知将提醒用户他们在会议开始前30分钟,会议开始前10分钟和会议开始前10分钟开会.(我们将FCM用作推送通知服务)

当前,对于每个新会议,我们都会根据AWS CloudWatch Events规则注册cron作业,但是我已经意识到,由于预期会有大量已注册的会议,这可能不是实现它的最佳方法...(例如如果我们要召开100次活动会议,那么我们将有300条已注册的CloudWatch Events规则...

所以我的问题是实现这种服务的更好方法吗?

客户端都是IOS(Swift)和Anrdoid(Java)

解决方案

绝对最好的方法是将会议数据推送或同步到移动应用,然后让移动应用管理通知./p>

如果您确实需要直接从云中发送通知,则应将系统设计为高度可伸缩的,能够处理成千上万次会议.

最简单的方法可能是在创建会议时在数据库中填充通知"表.在应通知用户的时间上添加一行.

然后,使用 Amazon CloudWatch Events 上的时间表,每分钟触发一次 AWS Lambda功能.Lambda函数应在数据库中查询在此分钟(或更早)安排的尚未发送的任何通知.(这样可以在失败后重试.)

通过 Amazon SNS Amazon Pinpoint 发送通知.然后,将通知标记为已发送.

I'm currently developing an app that has some sort of user meetings system, recently the our product team requested to include some scheduled push notifications that will remind the users that they have a meeting 30 mins before, 10 mins before and 10 minutes into the meeting. (We use FCM as a push notification service)

Currently for every new meeting we register a cron job on AWS CloudWatch Events rules, but I've come to realize that it's probably not the best way to implement it due to expected large number of registered meetings... (for example if we will have 100 active meetings, we will have 300 registered CloudWatch Events rules...

So my question is there a better way to implement such a service?

EDIT: The clients are both IOS(Swift) and Anrdoid(Java)

解决方案

Definitely the best way is to push or sync the meeting data to the mobile app and then have the mobile app manage notifications.

If you do need to send notifications directly from the cloud, you should design the system to be highly scalable, capable of handling thousands and even millions of meetings.

The easiest way would probably be to populate a 'notification' table in a database when a meeting is created. Add a row with the time that the user should be notified.

Then, use a schedule on Amazon CloudWatch Events to trigger an AWS Lambda function each minute. The Lambda function should query the database for any notifications scheduled for this minute (or earlier) that have not been sent. (This allows for retry after failures.)

Send a notification via Amazon SNS or Amazon Pinpoint. Then, mark the notification as having been sent.

这篇关于实施预定的推送通知的最佳方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆