按下推送通知后,我想导航到特定的视图控制器,如何在此处使用 OneSignal 推送通知进行操作?
_ = OneSignal(launchOptions: launchOptions, appId: "b2f7f966-d8cc-11e4-bed1-df8f05be55ba") { (message, additionalData, isActive) in
NSLog("OneSignal Notification opened:\nMessage: %@", message)
if additionalData != nil {
NSLog("additionalData: %@", additionalData)
// Check for and read any custom values you added to the notification
// This done with the "Additonal Data" section the dashbaord.
// OR setting the 'data' field on our REST API.
if let customKey = additionalData["newid"] as! Int {
//The navigation to a view controller code should be goes here...
//I've no idea how to do it, I've tried some ways from stackoverflow also didn't work for me
}
}
}