From 8664380e8cd95d2e44d05fe1ce69a5adb22df7ff Mon Sep 17 00:00:00 2001 From: Hamid Date: Sun, 28 Feb 2021 13:25:20 +0330 Subject: [PATCH] setNotificationSilent() --- android/build.gradle | 7 +------ .../modules/RNPushNotificationHelper.java | 2 ++ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/android/build.gradle b/android/build.gradle index 7bfeaed0b..5f1c5a319 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -45,14 +45,9 @@ android { } dependencies { - // Use either AndroidX library names or old/support library names based on major version of support lib - def supportLibVersion = safeExtGet('supportLibVersion', '27.1.1') - def supportLibMajorVersion = supportLibVersion.split('\\.')[0] as int - def appCompatLibName = (supportLibMajorVersion < 20) ? "androidx.appcompat:appcompat" : "com.android.support:appcompat-v7" - implementation fileTree(dir: 'libs', include: ['*.jar']) testImplementation 'junit:junit:4.12' - implementation "$appCompatLibName:$supportLibVersion" + implementation "androidx.appcompat:appcompat:1.2.0" implementation 'com.facebook.react:react-native:+' implementation 'me.leolin:ShortcutBadger:1.1.22@aar' implementation "com.google.firebase:firebase-messaging:${safeExtGet('firebaseMessagingVersion', '21.1.0')}" diff --git a/android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotificationHelper.java b/android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotificationHelper.java index ad3527bcb..851bb8ed7 100644 --- a/android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotificationHelper.java +++ b/android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotificationHelper.java @@ -431,6 +431,8 @@ public void sendToNotificationCentreWithPicture(Bundle bundle, Bitmap largeIconB soundUri = getSoundUri(soundName); notification.setSound(soundUri); + } else { + notification.setNotificationSilent(); } if (soundUri == null || Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {