마스터Q&A 안드로이드는 안드로이드 개발자들의 질문과 답변을 위한 지식 커뮤니티 사이트입니다. 안드로이드펍에서 운영하고 있습니다. [사용법, 운영진]

notification icon 배경색 질문입니다. (앱 foreground, background 차이)

0 추천

fcm 수신 시 최 상단 statusbar 와 컨트롤센터? 알림센터? 에 나오는 이미지 추가했습니다.

 

아이콘 설정 할 때 setColor 메서드를 통해 알림센터에 나오는 아이콘 백그라운드 색도 설정해줬구요.

 

그런데..

 

앱이 foreground 에 있을 때에는 제대로 표시됩니다.

백그라운드나 죽은 상태에서는 기본 백그라운드 회색으로 표시됩니다..

 

 - foreground 상태에서의 배경

 

  - background 또는 kill 상태에서의 배경

 

이렇게 나오네요..

 

notification 을 만들어주는 소스는 아래와 같구요

 

    Uri defaultSoundUri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
    android.support.v4.app.NotificationCompat.Builder notificationBuilder = new NotificationCompat.Builder(this)
            .setSmallIcon(R.drawable.ic_notification_small)
            .setPriority(Notification.PRIORITY_MAX)
            .setContentTitle(remoteMessage.getNotification().getTitle().toString())
            .setContentText(remoteMessage.getNotification().getBody().toString())
            .setAutoCancel(true)
            .setColor(ContextCompat.getColor(this, R.color.statusBarColor))
            .setSound(defaultSoundUri).setLights(000000255, 500, 2000)
            .setVibrate(new long[] {1000, 1000, 1000})
            .setContentIntent(pendingIntent);

 

manifast application 아래에다가

 

<meta-data
    android:name="com.google.firebase.messaging.default_notification_icon"
    android:resource="@drawable/ic_notification_small" />

 

이것도 추가했습니다.

 

무엇이 문제인가요

 

도움 주시면 감사하겠습니다.

윤둥이 (4,560 포인트) 님이 2017년 11월 23일 질문

답변 달기

· 글에 소스 코드 보기 좋게 넣는 법
· 질문에 대해 추가적인 질문이나 의견이 있으면 답변이 아니라 댓글로 달아주시기 바랍니다.
표시할 이름 (옵션):
개인정보: 당신의 이메일은 이 알림을 보내는데만 사용됩니다.
스팸 차단 검사:
스팸 검사를 다시 받지 않으려면 로그인하거나 혹은 가입 하세요.
...