Firebase 콘솔을 사용하여 알림을 보내고 있습니다. 백그라운드에서 알림을 받았지만 전경에서 알림을받지 못했습니다. 문서에서는, 그래서 그것을 추가,하지만 여전히 작동하지 않습니다 AppDelegate application:didReceiveRemoteNotification:
을 구현 말했다포 그라운드에서 알림이 표시되지 않음
당신이 UIAlertViewController
을 설정하고이를 제시 할 필요가 전경에있는 동안 내 코드
// [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]
아마도 이런 바보 같은 질문이지만, 당신이 작동하지 않습니다 말할 때, 당신은 당신이 응용 프로그램에서 검토하고 의미 장치가 Xcode 디버거에 연결되어 있고 콘솔에 NSLog 메시지가 표시되지 않는 경우 올바른지 확인하십시오. –