安排世博会通知并在一个小时后取消?
通过博览会为自己构建(Android)应用程序,并反应本地。我想向用户(ME)发送计划的时间敏感通知。如果用户在一个小时后没有与通知进行交互,则无关紧要,因此我想取消通知,而无需用户需要将通知取消。我想安排许多此类自动通知。
- 看起来没有一种方法来“安排”取消。似乎我可以使用
settimeout
和cancelscheduledefificationasyanc
在一个小时后取消它。有更好的方法吗? - 即使
settimeout
和cancelschedulednotificationAsync
适用于我计划的第一个通知,似乎我可能会在第二或第三次遇到麻烦。在settimeout
中等待的时间很多。我担心如果设备用完电池或其他东西,一切都会弄乱。更好的想法?
感谢您的帮助! :)
Building an (Android) app for myself through Expo and React Native. I want to send scheduled time-sensitive notifications to the user (me). If the user hasn't interacted with a notification after an hour, it's irrelevant, so I would like to cancel the notification without the user needing to dismiss it. I would like to schedule many of these auto-dismiss notifications.
- Doesn't look like there's a way to "schedule" a cancellation. Seems like I could use
setTimeout
andcancelScheduledNotificationAsync
to cancel it after an hour. Is there a better way? - Even if
setTimeout
andcancelScheduledNotificationAsync
works for the first notification I've scheduled, it seems like I could run into trouble with the second or third. That's a lot of time to be waiting insetTimeout
. I'm worried about everything getting messed up if the device runs out of battery or something. Better ideas?
Thank you for your help! :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论