print语句在通知内容扩展中不工作,尽管我能够修改标签文本和其他字段,下面是我的代码
class NotificationViewController: UIViewController, UNNotificationContentExtension {
@IBOutlet weak var label: UILabel!
override func viewDidLoad() {
super.viewDidLoad()
print("inside viewDidLoad of notificationViewController")
}
func didReceive(_ notification: UNNotification) {
self.label?.text = notification.request.content.body
print("inside didReceive of notificationViewController")
}}
发布于 2017-03-01 17:11:28
指向这里的下列步骤对我有用:
运行包含扩展的应用程序之后,
每次通过Xcode重新启动应用程序时,您都必须这样做。
https://stackoverflow.com/questions/42501458
复制相似问题