@imatis/react-native-notifications 4.3.3-imatis.5 → 4.3.3-imatis.7

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.
@@ -230,20 +230,20 @@ public class PushNotification implements IPushNotification {
230
230
  mMediaPlayer.setAudioStreamType(AudioManager.STREAM_ALARM);
231
231
 
232
232
  mMediaPlayer.prepare();
233
- mMediaPlayer.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
234
- public void onPrepared(MediaPlayer arg0) {
235
- mMediaPlayer.seekTo(0);
236
- mMediaPlayer.start();
233
+ mMediaPlayer.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {
234
+ @Override
235
+ public void onCompletion(MediaPlayer mp) {
236
+ mMediaPlayer.release(); // Release resources when playback completes
237
237
  }
238
238
  });
239
+ mMediaPlayer.start(); // Start playback immediately after preparing
239
240
 
240
241
  Vibrator v = (Vibrator) mContext.getSystemService(Context.VIBRATOR_SERVICE);
241
242
  // Vibrate with wave form
242
- long[] timings = new long[] { 50, 50, 50, 50, 50, 100, 350, 25, 25, 25, 25, 200 };
243
- int[] amplitudes = new int[] { 33, 51, 75, 113, 170, 255, 0, 38, 62, 100, 160, 255 };
244
- int repeatIndex = -1; // Do not repeat.
243
+ long[] timings = new long[]{0, 1000, 500, 1000};
244
+ int amplitude = VibrationEffect.DEFAULT_AMPLITUDE;
245
245
  if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
246
- v.vibrate(VibrationEffect.createWaveform(timings, amplitudes, repeatIndex));
246
+ v.vibrate(VibrationEffect.createWaveform(timings, amplitude));
247
247
  } else {
248
248
  //deprecated in API 26
249
249
  v.vibrate(3000);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@imatis/react-native-notifications",
3
- "version": "4.3.3-imatis.5",
3
+ "version": "4.3.3-imatis.7",
4
4
  "description": "Advanced Push Notifications (Silent, interactive notifications) for iOS & Android",
5
5
  "license": "MIT",
6
6
  "keywords": [