blob: 30a557c79880af34f67d6959b34e4c670099f81f [file] [log] [blame]
- (void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification
{
// Note: if app wasn't running, you can still get a LN and then it doesn't call this function,
// I think it calls app start but notifies you that LN caused the app start or something like that.
//UIApplicationState state = [application applicationState];
//BOOL wasForeground = (state == UIApplicationStateActive);
//NSString *title = [notification.userInfo objectForKey:@"title"];
//NSString *body = [notification.userInfo objectForKey:@"body"];
NSString *tag = [notification.userInfo objectForKey:@"tag"];
[(WebNotifications*)[self.viewController getCommandInstance:@"WebNotifications"] clickNofification:tag];
application.applicationIconBadgeNumber = 0;
application.scheduledLocalNotifications = [NSArray arrayWithArray:application.scheduledLocalNotifications]; // "hack" to clear seen notifications
}