@imatis/react-native-notifications 4.3.3-imatis.4 → 4.3.3-imatis.6

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 && soundUri != 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
  }
@@ -232,11 +239,10 @@ public class PushNotification implements IPushNotification {
232
239
 
233
240
  Vibrator v = (Vibrator) mContext.getSystemService(Context.VIBRATOR_SERVICE);
234
241
  // Vibrate with wave form
235
- long[] timings = new long[] { 50, 50, 50, 50, 50, 100, 350, 25, 25, 25, 25, 200 };
236
- int[] amplitudes = new int[] { 33, 51, 75, 113, 170, 255, 0, 38, 62, 100, 160, 255 };
237
- int repeatIndex = -1; // Do not repeat.
242
+ long[] timings = new long[]{0, 1000, 500, 1000};
243
+ int amplitude = VibrationEffect.DEFAULT_AMPLITUDE;
238
244
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
239
- v.vibrate(VibrationEffect.createWaveform(timings, amplitudes, repeatIndex));
245
+ v.vibrate(VibrationEffect.createWaveform(timings, amplitude));
240
246
  } else {
241
247
  //deprecated in API 26
242
248
  v.vibrate(3000);
@@ -328,7 +334,6 @@ public class PushNotification implements IPushNotification {
328
334
  defaultChannel.setLockscreenVisibility(Notification.VISIBILITY_PUBLIC);
329
335
  if (soundUri != null) {
330
336
  AudioAttributes audioAttributes = new AudioAttributes.Builder()
331
- .setContentType(AudioAttributes.CONTENT_TYPE_MUSIC)
332
337
  .setUsage(AudioAttributes.USAGE_NOTIFICATION)
333
338
  .build();
334
339
  defaultChannel.setSound(soundUri, audioAttributes);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@imatis/react-native-notifications",
3
- "version": "4.3.3-imatis.4",
3
+ "version": "4.3.3-imatis.6",
4
4
  "description": "Advanced Push Notifications (Silent, interactive notifications) for iOS & Android",
5
5
  "license": "MIT",
6
6
  "keywords": [