gpt4 book ai didi

notifications - 无法在 ios 10 通知中调试通知内容扩展

转载 作者:行者123 更新时间:2023-12-01 07:09:26 24 4
gpt4 key购买 nike

打印语句在通知内容扩展中不起作用,虽然我可以修改标签文本和其他字段,下面是我的代码

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")

}

}

最佳答案

以下步骤指向here为我工作:

After running the app that contains the extension,

  • Set your breakpoint in the extension
  • Select Debug / Attach to Process by PID or name
  • Enter the name of the extension target
  • Trigger the push notification
  • Breakpoints in extensions take forever to trigger. BE PATIENT, eventually your breakpoint will be hit

You will have to do this every time you restart your app via Xcode.

关于notifications - 无法在 ios 10 通知中调试通知内容扩展,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42501458/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com