Fixed Notification on Android O and later
This commit is contained in:
parent
b9213c75f7
commit
66f53d0b15
3 changed files with 6 additions and 4 deletions
|
@ -10,8 +10,8 @@ android {
|
|||
applicationId "io.github.z3r0c00l_2k.aquadroid"
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 27
|
||||
versionCode 2
|
||||
versionName "1.1"
|
||||
versionCode 3
|
||||
versionName "1.1.1"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
buildTypes {
|
||||
|
|
|
@ -60,6 +60,7 @@ class NotificationHelper(val ctx: Context) {
|
|||
notificationsTone: String?
|
||||
): Notification.Builder {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
|
||||
createChannels()
|
||||
return Notification.Builder(ctx.applicationContext, CHANNEL_ONE_ID)
|
||||
.setContentTitle(title)
|
||||
.setContentText(body)
|
||||
|
@ -82,10 +83,10 @@ class NotificationHelper(val ctx: Context) {
|
|||
.setLargeIcon(
|
||||
BitmapFactory.decodeResource(
|
||||
ctx.resources,
|
||||
io.github.z3r0c00l_2k.aquadroid.R.mipmap.ic_launcher
|
||||
R.mipmap.ic_launcher
|
||||
)
|
||||
)
|
||||
.setSmallIcon(io.github.z3r0c00l_2k.aquadroid.R.drawable.ic_small_logo)
|
||||
.setSmallIcon(R.drawable.ic_small_logo)
|
||||
.setAutoCancel(true)
|
||||
|
||||
notification.setShowWhen(true)
|
||||
|
|
1
fastlane/metadata/android/en-US/changelogs/3.txt
Normal file
1
fastlane/metadata/android/en-US/changelogs/3.txt
Normal file
|
@ -0,0 +1 @@
|
|||
* Fixed notification on Android O and later
|
Loading…
Reference in a new issue