Я внедрил контроллер SSASide Menu и после получения любого уведомления Когда я представляю контроллер View, SideMenu не работает.
Мой код в классе AppDelegate
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable: Any],
fetchCompletionHandler completionHandler: @escaping (UIBackgroundFetchResult) -> Void) {
if let messageID = userInfo[gcmMessageIDKey] {
print("Message ID: \(messageID)")
}
let info = userInfo as NSDictionary
let aps = info.value(forKey: "aps") as! NSDictionary
let dic = aps.value(forKey: "alert") as! NSDictionary
let val = dic.value(forKey: "body") as! String
let msg_id = userInfo[gcmMessageIDKey]
let str_screenKey = userInfo[screenKey] as! String
if str_screenKey == "Send_Invitation"{
// UserDefaults.standard.set(val, forKey: "msg_reminder") //setObject
UserDefaults.standard.set(info, forKey: "msg_reminder") //setObject
UserDefaults.standard.set(userInfo[gcmMessageIDKey], forKey: "msg_id") //setObject
UserDefaults.standard.set("yes", forKey: "isMsgAlert") //setObject
isMsgAlert = true
if UserDefaults.standard.bool(forKey: islogin) {
if let controller = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "SSASideMenu") as? SSASideMenu {
if let window = self.window, let rootViewController = window.rootViewController {
var currentController = rootViewController
while let presentedController = currentController.presentedViewController {
currentController = presentedController
}
currentController.present(controller, animated: true, completion: nil)
}
}
}
}//If screen check
}
Спасибо и всего наилучшего