如何在 iOS 中显示持续时间为 2 分钟的远程通知?
How to show remote notification for duration of 2 minutes in iOS?
我正在开发 Emergency Type 应用程序。我们的要求是当我们收到远程通知时显示通知并播放紧急声音 3 分钟。当我的应用程序是 running
或 suspended
时,我可以执行此操作。但是当应用程序 not-running
时,通知只显示几秒钟。
有没有什么办法可以在收到远程通知的时候让通知显示2分钟。我在 ios 应用程序中搜索了很多但没有找到任何方法来执行此操作。
这是通知的有效负载:
{"aps":{"alert":"Enter your message","badge":1,"sound":"pushAlert.mp3"}
不,这是不可能的,因为这是默认行为,您无法更改!我的意思是你不能用你的自定义时间显示通知,或者你不能为通知播放长音,因为它限制在 30 seconds
。检查 Apple Doc says ,
Custom sounds must be under 30 seconds when played. If a custom sound is over that limit, the default system sound is played instead.
我正在开发 Emergency Type 应用程序。我们的要求是当我们收到远程通知时显示通知并播放紧急声音 3 分钟。当我的应用程序是 running
或 suspended
时,我可以执行此操作。但是当应用程序 not-running
时,通知只显示几秒钟。
有没有什么办法可以在收到远程通知的时候让通知显示2分钟。我在 ios 应用程序中搜索了很多但没有找到任何方法来执行此操作。 这是通知的有效负载:
{"aps":{"alert":"Enter your message","badge":1,"sound":"pushAlert.mp3"}
不,这是不可能的,因为这是默认行为,您无法更改!我的意思是你不能用你的自定义时间显示通知,或者你不能为通知播放长音,因为它限制在 30 seconds
。检查 Apple Doc says ,
Custom sounds must be under 30 seconds when played. If a custom sound is over that limit, the default system sound is played instead.