I have a Phonegap App where I recieve Push Notifications. I send a "Pagekey" in the payload, which tells the App which HTML Page to open after the App starts on a received Push Notification.
I do the following in the - (BOOL) application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions
(Snippets)
NSDictionary* extras = [launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey];
NSString *key = ((NSString*)[extras objectForKey:@"pagekey"]);//get the Pagekey
NSLog(@"key: %@", key); //prints out "2" (2 without the "")
//Load the HTML Page depending on the pagekey
self.viewController.wwwFolderName = @"www";
if([key isEqual:@"2"]){
NSLog(@"Im in the 2 branch");
self.viewController.startPage = @"winnings.html";
}else{
NSLog(@"Im in the else branch");//this branch is executed(unexpected behaviour)
self.viewController.startPage = @"index.html";
}
the pagekey was originally JSON Data, sent from a push notification server. Anyone knows how to compare the String properly so the correct branch is executed? thanks a lot in advance!