2020년 9월 17일 IOS 14가 정식 오픈 되었습니다.

 

베타 버전을 깔지 않았던 저는 아침에 일어나자마자 IOS업데이트를 했죠.

 

그런데 업데이트를 하고 회사 업무 어플에 접속을하니 자꾸 튕기네요....

 

Google Analytics를 확인해 보았더니 AppDelegate.swift에서 didFailToRegisterForRemoteNotificationsWithError의 구문에러...

 

확인해보니..

 

Xcode업데이트 후 build Settings -> product Name 이 한글이었습니다...(ios13까지는 문제없었던곳)

 

이부분을 영문으로 바꾼후 빌드하니.

 

fcm토큰 제대로 나오고 푸시기능 다시 살아났습니다.

 

휴..

 

다시 빌드해서 심사 올려보내야겠습니다...(gps때문에 리젝났는데 언제 다시 승인 날지..)

 

아래는 해당 오류 관련 github의 글이고 해당글도 한국분들께서 오류가 나서 찾으신것 같습니다.

 

github.com/invertase/react-native-firebase/issues/4093

 

iOS 14 Beta4 push notification permission failed · Issue #4093 · invertase/react-native-firebase

Issue First. I have no error in iOS 12/13 now. but iOS 14 Beta4 push notification permission failed. Exception thrown when 'await messaging().requestPermission();' is called. when requestPe...

github.com

 

 

반응형

언젠가 부터 안드로이드 O 오레오 버전 이후 휴대폰에서 푸시가 안오기 시작한다.

 

테스트

- FCM 콘솔에서 메시지 전송 (수신 OK)

- push https://fcm.googleapis.com/fcm/send로 POST 전송(수신X)

 

원인 : GCM 에서 FCM 으로 바뀌면서 json 형식에 Notification 영역이 생김

 

약 1개월전 앱이 포그라운드일때 푸시 안오는 현상으로 코드 수정후 업데이트함.

 

그때 수정한 코드가 문제....

 

다시 처음부터 시작..

 

기존 GCM 관련 코드 전부 걷어내고 FCM 으로 코드작성

 

.json파일 연동 부터 시작.

 

(포그라운드) 안드로이드에서 푸시 메시지를 받으면 FirebaseMessagingService.java 의 OnMessageReceived를 타게됨

 

(백그라운드) Logcat 에서 로그가 안찍힘(그런데 푸시알림은 옴..)

 

구글링 해서 찾은 결과.

 

백그라운드에서는 FCM 으로 전송할때  json 에서 Notification 의 title 과 body가 있으면 안드로이드에서 직접 처리해서 푸시알림을 띄우는것 같음

 

안드로이드 Oreo이상에서는 아래 코드 필수

 

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {


            NotificationChannel notificationChannel = new NotificationChannel(id, name, NotificationManager.IMPORTANCE_DEFAULT);

            // Configure the notification channel.
            notificationChannel.setDescription(description);

            notificationChannel.enableLights(true);
            // Sets the notification light color for notifications posted to this
            // channel, if the device supports this feature.
            notificationChannel.setLightColor(Color.RED);

            notificationChannel.enableVibration(true);
            notificationChannel.setVibrationPattern(vibraPattern);

            notificationManager.createNotificationChannel(notificationChannel);
        }

Oreo이상 버전을 체크한후 채널을 생성해 주어야함.

 

채널을 생성해주지 않으면 앱에서는 푸시알림을 받지않음 (맨처음에 나타났던 문제... Oreo이상버전에서 푸시알림이 오지않는 문제)

 

 

코드 수정후 문제점.

 

- Developer warning for package "패키지명" Failed to post notificcation on channel "null" See log for more detail

 

에러 발생 

 

채널을 생성해주어야 없어지는 에러라는데 채널을 생성해 주었는데도 계속 나타난다.

 

무엇때문에 나타나는 에러인지는 확인이 필요하다.

 

 

 

 

 

 

 

 

 

 

 

반응형

+ Recent posts