You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
채널을 만들기 위해서 ( ID, NAME ) 그리고 ( Notification ) 의 중요도가 필요함.
val channel = NotificationChannel( channel_ID, channel_Name, NotificationManager.IMPORTANCE_HIGH )
아래 코드를 통해 화면에 보이는 앱 배너 알림이 왔다는 표시가 뜸 ( ex: 카톡 아이콘 옆에 숫자... )
channel.SetShowBadge( Boolean )
5. Attribution ( 추가 설정 )
1) RingtoneManager
RingtoneManager의 Uri 와 audioAtrribute가 필요함.
Uri 는 RingtoneManager의 Type에 따른 Uri를 getDefaultUri( Type ) 을 통해 얻을 수 있음.
audioAtrribute는 AudioAttribute.Builder() 를 통해 생성하고 setContentType, setUsage 등을 통해 설정할 수 있음
또한 Builder로 정의되었기에 마지막에 .builder() 로 마무리함.
val uri: Uri = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION)
val audioAttributes = AudioAttributes.Builder()
.setContentType(AudioAttributes.CONTENT_TYPE_SONIFICATION)
.setUsage(AudioAttributes.USAGE_ALARM)
.build()