Skip to content
This repository was archived by the owner on Jan 14, 2025. It is now read-only.

Commit 795c64c

Browse files
author
Boris Tacyniak
authored
Merge pull request #1686 from mineshpatel1/master
Fix for vibration on notifs for Android API >= 26
2 parents e80d36a + 0638367 commit 795c64c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ To use channels, create them at startup and pass the matching `channelId` throug
406406
);
407407
```
408408

409-
**NOTE: Without channel, remote notifications don't work**
409+
**NOTE: Without channel, notifications don't work**
410410

411411
In the notifications options, you must provide a channel id with `channelId: "your-channel-id"`, if the channel doesn't exist the notification might not e triggered. Once the channel is created, the channel cannot be update. Make sure your `channelId` is different if you change these options. If you have created a channel in another way, it will apply options of the channel.
412412

android/src/main/java/com/dieam/reactnativepushnotification/modules/RNPushNotificationHelper.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ public void sendToNotificationCentreWithPicture(Bundle bundle, Bitmap largeIconB
446446
if (vibration == 0)
447447
vibration = DEFAULT_VIBRATION;
448448

449-
vibratePattern = new long[]{0, vibration};
449+
vibratePattern = new long[]{vibration};
450450

451451
notification.setVibrate(vibratePattern);
452452
}
@@ -908,7 +908,7 @@ public boolean createChannel(ReadableMap channelInfo) {
908908
String soundName = channelInfo.hasKey("soundName") ? channelInfo.getString("soundName") : "default";
909909
int importance = channelInfo.hasKey("importance") ? channelInfo.getInt("importance") : 4;
910910
boolean vibrate = channelInfo.hasKey("vibrate") && channelInfo.getBoolean("vibrate");
911-
long[] vibratePattern = vibrate ? new long[] { DEFAULT_VIBRATION } : null;
911+
long[] vibratePattern = vibrate ? new long[] { 0, DEFAULT_VIBRATION } : null;
912912

913913
NotificationManager manager = notificationManager();
914914

0 commit comments

Comments
 (0)