react-native-push-notification
react-native-push-notification copied to clipboard
vibrate:false is ignored in "vibrate mode"
react-native: 0.63.4 react-native-push-notification: 7.3.1
I created 2 channel
PushNotification.createChannel(
{
channelId: 'channel a',
channelName: 'channel a',
channelDescription: 'description a',
vibrate: true,
},
(created: boolean) => {},
);
PushNotification.createChannel(
{
channelId: 'channel b',
channelName: 'channel b',
channelDescription: 'description b',
vibrate: false,
},
(created: boolean) => {},
);
I made push
...
PushNotification.localNotificationSchedule({
channelId: 'channel a',
id: 1,
date: new Date(JSON.parse(obj.date)),
autoCancel: false,
ongoing: false,
allowWhileIdle: true,
userInfo: obj,
title,
message,
playSound,
soundName,
volume: _volume,
vibrate: true,
vibration: 2000,
repeatType,
repeatTime,
ignoreInForeground: false,
});
...
PushNotification.localNotificationSchedule({
channelId: 'channel b',
id: 2,
date: new Date(JSON.parse(obj.date)),
autoCancel: false,
ongoing: false,
allowWhileIdle: true,
userInfo: obj,
title,
message,
playSound,
soundName,
volume: _volume,
vibrate: false, // Changed it to false because it was written as true
vibration: 2000,
repeatType,
repeatTime,
ignoreInForeground: false,
});
[My test device (Android Galaxy S9) setting] -> Vibrate Mode -> When I created a push with ids 1 and 2 id(1) - not vibrate (normal) id(2) - vibrate (abnormal - I expected no vibrate in vibrate mode)
I created 'channel b' with vibrate false, why does id 2 push vibrate in vibrate mode? How can I solve this?
hi @daheeahn
Make sure the channel b
wasn't created with vibrate: true
then changed to vibrate: false
.
Update a channel is not possible.
Regards
@Dallas62 I didn't understand. 'channel b' created with vibrate: false. and I removed app and reinstalled. How can I do?
Can you check in phone settings if the created channel is with vibration disabled ? We need to make sure channels are correctly configured.
FYI, If the push made with the b-channel is in sound mode, it doesn't vibrate as I expected. But in vibrate mode, it vibrates.


Channel a, b in order
Hi @daheeahn
If everything is right, I suggest you to set vibrate: false
in your PushNotification.localNotificationSchedule
call.
If vibrate is ignore, it's probably an issue (behavour?) of Android...
The library create the channel correctly and apply all parameters send by your application. After that it's Android which handle the notification.
Regards
Oh, I changed the vibrate of push with id: 2
to false
because it was written as true
by mistake.
It's a very simple test, can you try it yourself on your Android device? I think I typed everything well as provided by the library.
I'm confused, but can you fix your exemple ? You said notification with id 1 is not vibrating, but in your exemple it's suppose to vibrate. And the id 2 is vibrating when you don't expect it. I suspect a channel swap
When the push with id 2 is in sound mode
or silent mode
, it doesn't vibrate as I want it to. But in vibrating mode
, it vibrates. I think it should not vibrate even in vibrate mode
, but I don't know why it vibrates only in vibrate mode
.
And the channel was not confused.
(Only Android
)
Ok, but reading your initial post, channel b (notification id 2) is all no vibration.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 30 days if no further activity occurs. Thank you for your contributions.