创建持久的iOS横幅通知 [英] Create a persistent iOS banner notification

查看:263
本文介绍了创建持久的iOS横幅通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道IOS的早期版本,但是iOS 11具有以下功能:

I don't know about early versions of IOS, but iOS 11 has a feature:

如何在我的IOS应用中以编程方式快速创建持久通知?我没有找到有关它的任何文档.

How to create a persistent notification programmatically with swift in my IOS app? I didn't found any docs about it.

我也找到了这个答案:在iOS中创建持久性通知,但是很久以前,也许情况已经改变了?

I also found this answer: Create a persistent notification in iOS but it was a long time ago, maybe the situation has changed ?

推荐答案

您要描述的功能是本地通知.在此处查看文档:

The feature you're describing is a local notification. See the docs here:

https://developer.apple.com/documentation/usernotifications

您不能对用户强制通知或通知的样式.这就是屏​​幕快照中设置"窗口的含义.只有用户可以决定您的通知警报将显示为临时"还是永久". (用户还可以决定完全隐藏您的通知.)

You cannot force notifications or their style on the user. That is what the Settings window in your screen shot is about. Only the user can decide whether your notification alert will appear as Temporary or Persistent. (The user can also decide to suppress your notifications completely.)

这篇关于创建持久的iOS横幅通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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