Skip to content

Commit 589dac7

Browse files
authored
Merge pull request zetavg#51 from varungupta85/master
Play custom sound when the sound is set for local notification
2 parents 77b0aa7 + cb5217e commit 589dac7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

android/src/main/java/io/neson/react-native/notification/Notification.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import android.content.Intent;
1212
import android.content.SharedPreferences;
1313
import android.support.annotation.Nullable;
14+
import android.net.Uri;
1415

1516
import java.lang.System;
1617
import java.util.HashMap;
@@ -228,6 +229,10 @@ else if (attributes.bigStyleImageBase64 != null) {
228229
notificationBuilder.setLocalOnly(attributes.localOnly);
229230
}
230231

232+
if (attributes.sound != null) {
233+
notificationBuilder.setSound(Uri.parse(attributes.sound));
234+
}
235+
231236
return notificationBuilder.build();
232237
}
233238

0 commit comments

Comments
 (0)