File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed
OneSignalSDK/onesignal/src/main/java/com/onesignal Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -251,7 +251,7 @@ private static NotificationCompat.Builder getBaseNotificationCompatBuilder(JSONO
251251 if (bigPictureIcon != null )
252252 notifBuilder .setStyle (new NotificationCompat .BigPictureStyle ().bigPicture (bigPictureIcon ).setSummaryText (message ));
253253
254- if (OneSignal . getSoundEnabled ( currentContext )) {
254+ if (isSoundEnabled ( gcmBundle )) {
255255 Uri soundUri = getCustomSound (gcmBundle );
256256 if (soundUri != null )
257257 notifBuilder .setSound (soundUri );
@@ -677,10 +677,17 @@ private static int getDrawableId(String name) {
677677 return contextResources .getIdentifier (name , "drawable" , packageName );
678678 }
679679
680+ private static boolean isSoundEnabled (JSONObject gcmBundle ) {
681+ String sound = gcmBundle .optString ("sound" , null );
682+ if ("null" .equals (sound ) || "nil" .equals (sound ))
683+ return false ;
684+ return OneSignal .getSoundEnabled (currentContext );
685+ }
686+
680687 private static Uri getCustomSound (JSONObject gcmBundle ) {
681688 int soundId ;
682689 String sound = gcmBundle .optString ("sound" , null );
683-
690+
684691 if (isValidResourceName (sound )) {
685692 soundId = contextResources .getIdentifier (sound , "raw" , packageName );
686693 if (soundId != 0 )
Original file line number Diff line number Diff line change @@ -167,7 +167,7 @@ public void init() {
167167 private static TrackGooglePurchase trackGooglePurchase ;
168168 private static TrackAmazonPurchase trackAmazonPurchase ;
169169
170- public static final String VERSION = "030101 " ;
170+ public static final String VERSION = "030200 " ;
171171
172172 private static AdvertisingIdentifierProvider mainAdIdProvider = new AdvertisingIdProviderGPS ();
173173
You can’t perform that action at this time.
0 commit comments