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
251
251
if (bigPictureIcon != null )
252
252
notifBuilder .setStyle (new NotificationCompat .BigPictureStyle ().bigPicture (bigPictureIcon ).setSummaryText (message ));
253
253
254
- if (OneSignal . getSoundEnabled ( currentContext )) {
254
+ if (isSoundEnabled ( gcmBundle )) {
255
255
Uri soundUri = getCustomSound (gcmBundle );
256
256
if (soundUri != null )
257
257
notifBuilder .setSound (soundUri );
@@ -677,10 +677,17 @@ private static int getDrawableId(String name) {
677
677
return contextResources .getIdentifier (name , "drawable" , packageName );
678
678
}
679
679
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
+
680
687
private static Uri getCustomSound (JSONObject gcmBundle ) {
681
688
int soundId ;
682
689
String sound = gcmBundle .optString ("sound" , null );
683
-
690
+
684
691
if (isValidResourceName (sound )) {
685
692
soundId = contextResources .getIdentifier (sound , "raw" , packageName );
686
693
if (soundId != 0 )
Original file line number Diff line number Diff line change @@ -167,7 +167,7 @@ public void init() {
167
167
private static TrackGooglePurchase trackGooglePurchase ;
168
168
private static TrackAmazonPurchase trackAmazonPurchase ;
169
169
170
- public static final String VERSION = "030101 " ;
170
+ public static final String VERSION = "030200 " ;
171
171
172
172
private static AdvertisingIdentifierProvider mainAdIdProvider = new AdvertisingIdProviderGPS ();
173
173
You can’t perform that action at this time.
0 commit comments