2017-08-17 57 views

回答

0

當應用程序在後臺通知被 didReceiveRemoteNotification

第一次啓動處理,但是你需要解析的任何通知的launchOptions在didFinishLaunchingWithOptions 喜歡的東西:

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 
    if let remoteNotification = launchOptions?[UIApplicationLaunchOptionsKey.remoteNotification] as? NSDictionary { 
     print("we got a notification \(remoteNotification)") 
     //your logic here (launch controller etc) 
    } 
} 
相關問題