<分区>
我有以下 appDelegate:
import UIKit
import CoreData
import UserNotifications
@available(iOS 11.0, *)
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate, UNUserNotificationCenterDelegate
{
var window: UIWindow?
...
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any])
{
print("xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
}
}
我使用的是 ios11 和 swift 4.1,但通知被正确触发。但是当我点击它时,我无法在应用程序中抓取它。为什么?我正在使用 xcode 9.4.1。谢谢。
该应用程序在后台运行,当点击通知时,该应用程序将打开。