Created
March 10, 2020 06:37
-
-
Save ITechRoof/9924a8ed716565dbc82e709b3206dacb to your computer and use it in GitHub Desktop.
Receive notification
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult result))completionHandler { | |
NSLog(@"Notification received"); | |
completionHandler(UIBackgroundFetchResultNewData); | |
} | |
- (void)userNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(void (^)(UNNotificationPresentationOptions result))completionHandler { | |
NSLog(@"Foreground: Notification received"); | |
completionHandler(UNNotificationPresentationOptionAlert + UNNotificationPresentationOptionSound + UNNotificationPresentationOptionBadge); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment