且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

iPhone报警使用重复的本地通知

更新时间:2023-02-26 20:47:33

恐怕你无法实现这一点。正如你所说的关闭按钮。如果点击关闭按钮,您将不会在应用程序中收到任何回叫。此外,即使您每30秒发出一次通知,屏幕上也会有多个通知,用户必须查看或关闭这些通知。所以用户体验会很糟糕。我建议用户明确表示他们无法使用超过30秒的自定义声音设置闹钟。

I am afraid you cannot accomplish this..reason being as you stated the 'Close' button. You won't be getting any call back in the app if Close button is tapped. Further even if you present notifications every 30 seconds, then there will be multiple notifications on the screen which user has to view or close. So the user experience will be crappy. I would recommended making it clear to the users that they can not set alarm with a custom sound more than 30 seconds.