Wrapped notification channel getter method in sdk if statement to fix notifications not arriving on Android 5-7

This commit is contained in:
Deniz Düzgören
2019-09-09 16:18:33 +02:00
parent 47a4a51b44
commit 48ec7f8829
2 changed files with 6 additions and 6 deletions
@@ -211,11 +211,11 @@ internal class DataFetcher(isPlan: Boolean, isMenu: Boolean, isJobService: Boole
val manager = mContext.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
HelperFunctions.getNotificationChannel(mContext, prefs)
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
HelperFunctions.getNotificationChannel(mContext, prefs)
}
val notification = NotificationCompat.Builder(mContext,
HelperFunctions.notificationChannelId
)
val notification = NotificationCompat.Builder(mContext, HelperFunctions.notificationChannelId)
.setStyle(NotificationCompat.DecoratedCustomViewStyle())
.setCustomContentView(notificationLayout)
.setSmallIcon(R.drawable.ic_avh)