I'm using Firebase Console to send notification. When in background I received notification but when I'm in foreground I doesn't receive any notification. In the documentation, it was said to implement AppDelegate application:didReceiveRemoteNotification:
so i added it, but still doesn't work
Here is my code
// [START receive_message]
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
fetchCompletionHandler:(void (^)(UIBackgroundFetchResult))completionHandler {
// Print message ID.
NSLog(@"Message ID: %@", userInfo[@"gcm.message_id"]);
// Pring full message.
NSLog(@"%@", userInfo);
}
// [END receive_message]