Skip to content

Instantly share code, notes, and snippets.

@mkwatson
Created May 29, 2015 14: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 mkwatson/de34c2f149fbf3647a4e to your computer and use it in GitHub Desktop.
Save mkwatson/de34c2f149fbf3647a4e to your computer and use it in GitHub Desktop.
- (void)receivedBackgroundNotification:(NSDictionary *)notification fetchCompletionHandler:(void ( ^ ) ( UIBackgroundFetchResult result ))completionHandler {
// Recieved a pushed message, do we display to this user?
if ([self displayPushedMessage]){
// Display message and record event
[self didRecieveNotification:notification displayedMessage:true];
completionHandler()
}
else {
// Don't display message and record event
[self didRecieveNotification:notification displayedMessage:false];
completionHandler(UIBackgroundFetchResultNoData);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment