rah*_*mar 3 notifications apple-push-notifications ios10
print语句在通知内容扩展中不起作用,虽然我能够修改Label文本和其他字段,下面是我的代码
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")
}
Run Code Online (Sandbox Code Playgroud)
}
| 归档时间: |
|
| 查看次数: |
3104 次 |
| 最近记录: |