Skip to content

Instantly share code, notes, and snippets.

@tleyden
Created February 3, 2016 20:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tleyden/97434117ad53757106ad to your computer and use it in GitHub Desktop.
Save tleyden/97434117ad53757106ad to your computer and use it in GitHub Desktop.
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
{
NSString *msg = [[[userInfo objectForKey:@"aps"] objectForKey:@"alert"] objectForKey:@"body"];
if (msg == nil) {
msg = @"Error";
}
UIApplicationState state = [application applicationState];
if (state == UIApplicationStateActive) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"OfficeRadar"
message:msg
delegate:self cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alert show];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment