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
+2 -2
View File
@@ -10,8 +10,8 @@ android {
applicationId "com.denizd.substitutionplan"
minSdkVersion 21
targetSdkVersion 28
versionCode 31
versionName "2.2.8"
versionCode 32
versionName "2.2.9"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
@@ -211,11 +211,11 @@ internal class DataFetcher(isPlan: Boolean, isMenu: Boolean, isJobService: Boole
val manager = mContext.getSystemService(Context.NOTIFICATION_SERVICE) as NotificationManager
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)