I assume your problem is here:
launchOptions(UIApplicationLaunchOptionsRemoteNotificationKey) as NSDictionary
I'm not sure what you expect, but as far as I know, there is no such method in the dictionary. You may be looking for substring syntax. Something like that:
launchOptions[UIApplicationLaunchOptionsRemoteNotificationKey] as NSDictionary
To get the dictionary embedded in the turnkey launchOptions dictionary: UIApplicationLaunchOptionsRemoteNotificationKey.
As they say, launchOptions can be null, you should add this check to your code, and also try to register launchOptions and publish the results here.
You can check if startOptions are null:
if let launchOpts = launchOptions { var notificationPayload: NSDictionary = launchOpts.objectForKey(UIApplicationLaunchOptionsRemoteNotificationKey) as NSDictionary }
source share