@imatis/react-native-notifications 4.3.3-imatis.4 → 4.3.3-imatis.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -202,8 +202,15 @@ public class PushNotification implements IPushNotification {
|
|
|
202
202
|
String channelId = mNotificationProps.getChannelId();
|
|
203
203
|
channelId = channelId != null ? channelId : DEFAULT_CHANNEL_ID + sound;
|
|
204
204
|
NotificationChannel channel = notificationManager.getNotificationChannel(channelId);
|
|
205
|
-
if (channel == null
|
|
205
|
+
if (channel == null) {
|
|
206
206
|
initDefaultChannel(mContext, channelId, soundUri);
|
|
207
|
+
} else {
|
|
208
|
+
if (soundUri != null) {
|
|
209
|
+
AudioAttributes audioAttributes = new AudioAttributes.Builder()
|
|
210
|
+
.setUsage(AudioAttributes.USAGE_NOTIFICATION)
|
|
211
|
+
.build();
|
|
212
|
+
channel.setSound(soundUri, audioAttributes);
|
|
213
|
+
}
|
|
207
214
|
}
|
|
208
215
|
notification.setChannelId(channelId);
|
|
209
216
|
}
|
|
@@ -328,7 +335,6 @@ public class PushNotification implements IPushNotification {
|
|
|
328
335
|
defaultChannel.setLockscreenVisibility(Notification.VISIBILITY_PUBLIC);
|
|
329
336
|
if (soundUri != null) {
|
|
330
337
|
AudioAttributes audioAttributes = new AudioAttributes.Builder()
|
|
331
|
-
.setContentType(AudioAttributes.CONTENT_TYPE_MUSIC)
|
|
332
338
|
.setUsage(AudioAttributes.USAGE_NOTIFICATION)
|
|
333
339
|
.build();
|
|
334
340
|
defaultChannel.setSound(soundUri, audioAttributes);
|
package/package.json
CHANGED