简体   繁体   English

有没有办法管理远程通知在横幅上显示更长时间的持续时间?

[英]is there a way to manage the duration of the remote notification to be displayed longer on the banner?

I am working on an App which I want the Playload notification to remain presented in the banner until the user clicks on it.我正在开发一个应用程序,我希望 Playload 通知一直显示在横幅中,直到用户点击它。 I have two cases:我有两种情况:

  • App in background, after opening the app (not through the notification) the notification disappears.应用在后台,打开应用后(不是通过通知)通知消失。
  • App in foreground, the notification will be presented on the banner (I used: UNUserNotificationCenterDelegate for that) but after few seconds it disappears.应用程序在前台,通知将显示在横幅上(我使用:UNUserNotificationCenterDelegate)但几秒钟后它消失了。

is there a way to manage the notification duration, I want it to be presented until the user clicks on it.有没有办法管理通知持续时间,我希望在用户点击它之前一直显示它。

This is known as a Banner Style.这被称为横幅样式。 It can be set to either Temporary or Persistent with persistent banners requiring user interaction to disappear.它可以设置为 Temporary 或 Persistent 以及需要用户交互才能消失的持久横幅。 You can not manipulate the duration of your notifications being displayed on screen.您无法操纵屏幕上显示的通知的持续时间。 The banner style for the application can only be changed by the user in the notification settings for your application:应用程序的横幅样式只能由用户在应用程序的通知设置中更改:

在此处输入图片说明

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

相关问题 XCUITest远程通知单击横幅 - XCUITest Remote notification clicking on banner 在通知横幅中显示推送通知之前对其进行处理 - Handle Push Notification before it is displayed in the Notifications Banner 在 swift 远程通知中,有没有办法在应用程序被杀死时在横幅中显示不同于从服务器收到的消息? - In swift remote notification is there a way to display a different message in the banner other than the one received from server when app is killed? 有什么方法可以监听 UITableView 中不再显示的单元格吗? - Is there any way to listen for cells that are no longer displayed in a UITableView? 是否可以防止显示远程通知? - Is it possible to prevent a remote notification from being displayed? 取消推送通知横幅 - Dismiss push notification banner 通知横幅样式iOS - Notification banner style iOS 我们如何在通知中心显示之前拦截远程推送通知并更改其内容? - How can we intercept remote push notification and change its content before it gets displayed in the notification center? 使用 Swift 在 Mac 上显示通知横幅 - Showing notification banner on Mac with Swift 如果声音持续时间为 24 秒,是否有任何方法可以停止播放以前的通知声音? - Is There any way to Stop Playing previous Notification Sound if sound is 24 seconds of duration?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM