Last active
March 31, 2018 15:54
-
-
Save meyusufdemirci/bc807619594457d1ee8339cf99db45b5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func application(_ application: UIApplication, didReceiveRemoteNotification userInfo: [AnyHashable : Any]) { | |
switch application.applicationState { | |
// uygulama ön planda aktif kullanılıyorken | |
case .active: | |
break | |
// uygulama arka planda çalışıyor ve etkinlikleri alabiliyor | |
case .background: | |
break | |
// uygulama arka planda çalışıyor ama etkinlikleri alamıyor | |
case .inactive: | |
if let notificationDict = userInfo["aps"] as? [String: Any] { | |
if let viewController = self.window?.rootViewController as? ViewController { | |
DispatchQueue.main.async { | |
viewController.setAction(actionType: (notificationDict["actionType"] as? String)!) | |
self.actionType = nil | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment