从本地通知操作唤醒您的应用程序 - Swift

Wake up your app from a local notification action - Swift

我的应用在特定时间安排包含两个操作的本地通知。 当它到达 phone 时(几个小时后),我的应用程序已经处于暂停状态,按下任何操作按钮都不会导致任何结果或只是使应用程序崩溃。

在文档中我读到 didReceiveRemoteNotification 方法适用于处理此类任务并将应用程序从挂起状态唤醒,但我不知道如何正确执行操作。

谢谢!

didReceiveRemoteNotification 在您通过 APNS 收到推送通知时调用。您应该在 AppDelegate 中使用 didReceiveLocalNotification 的处理程序。