Skip to content
Snippets Groups Projects
Commit 5bd44bd6 authored by Maxime Graulich's avatar Maxime Graulich
Browse files

iOS: do not show Icon Badge & do not notify if onelab is foreground

parent bef0e8d7
No related branches found
No related tags found
No related merge requests found
...@@ -50,4 +50,10 @@ ...@@ -50,4 +50,10 @@
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
} }
-(void)application:(UIApplication *)application didReceiveLocalNotification:(UILocalNotification *)notification
{
application.applicationIconBadgeNumber = -1;
[UIApplication sharedApplication].applicationIconBadgeNumber = -1;
}
@end @end
...@@ -140,9 +140,10 @@ ...@@ -140,9 +140,10 @@
onelab_cb("compute"); onelab_cb("compute");
appDelegate->compute = NO; appDelegate->compute = NO;
UILocalNotification *localNotif = [[UILocalNotification alloc] init]; UILocalNotification *localNotif = [[UILocalNotification alloc] init];
if (localNotif) { if ([UIApplication sharedApplication].applicationState == UIApplicationStateBackground && localNotif) {
localNotif.alertBody = @"Computation finished"; localNotif.alertBody = @"Computation finished";
localNotif.alertAction = @"View"; localNotif.alertAction = @"View";
localNotif.hasAction = true;
localNotif.soundName = UILocalNotificationDefaultSoundName; localNotif.soundName = UILocalNotificationDefaultSoundName;
localNotif.applicationIconBadgeNumber = 1; localNotif.applicationIconBadgeNumber = 1;
[[UIApplication sharedApplication] scheduleLocalNotification:localNotif]; [[UIApplication sharedApplication] scheduleLocalNotification:localNotif];
...@@ -152,6 +153,7 @@ ...@@ -152,6 +153,7 @@
}); });
dispatch_group_notify(group, dispatch_get_main_queue(), ^{ dispatch_group_notify(group, dispatch_get_main_queue(), ^{
[UIApplication sharedApplication].applicationIconBadgeNumber = -1;
[_runStopButton setAction:@selector(compute)]; [_runStopButton setAction:@selector(compute)];
[_runStopButton setTitle:@"Run"]; [_runStopButton setTitle:@"Run"];
[_progressLabel setHidden:YES]; [_progressLabel setHidden:YES];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment