Disabling vibrate and playSound doesn't work
See original GitHub issueBug
When using parameters playSound
and vibrate
set to false
, neither has reflection in real life.
Environment info
➜ npx react-native info
info Fetching system and libraries information...
System:
OS: Linux 4.15 Ubuntu 18.04.4 LTS (Bionic Beaver)
CPU: (12) x64 AMD Ryzen 5 2600 Six-Core Processor
Memory: 2.05 GB / 15.68 GB
Shell: 5.4.2 - /usr/bin/zsh
Binaries:
Node: 12.15.0 - /usr/bin/node
Yarn: Not Found
npm: 6.13.4 - /usr/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
Android SDK: Not Found
IDEs:
Android Studio: Not Found
Languages:
Python: 2.7.17 - /usr/bin/python
npmPackages:
@react-native-community/cli: Not Found
react: ^16.13.1 => 16.13.1
react-native: ^0.62.0 => 0.62.0
npmGlobalPackages:
*react-native*: Not Found
Library version: 3.1.9
Steps To Reproduce
- Invoke
PushNotification.localNotification
function with proper parameters (listed below) - Observe that the phone plays sound and vibrates.
Describe what you expected to happen:
- The phone should not vibrate nor play sound.
Reproducible sample code
PushNotification.localNotification({
/* Android Only Properties */
id: 2,
// autoCancel: true, // (optional) default: true
largeIcon: 'ic_launcher', // (optional) default: "ic_launcher"
smallIcon: 'ic_notification', // (optional) default: "ic_notification" with fallback for "ic_launcher"
vibrate: false, // (optional) default: true
/* iOS only properties */
// alertAction: 'view', // (optional) default: view
// category: '', // (optional) default: empty string
// userInfo: {}, // (optional) default: {} (using null throws a JSON value '<null>' error)
/* iOS and Android properties */
title: 'My Notification Title', // (optional)
message: 'My Notification Message', // (required)
playSound: false,
priority: 'min',
// date: new Date(Date.now() + 1),
});
Issue Analytics
- State:
- Created 3 years ago
- Comments:6
Top Results From Across the Web
How To Disable Vibrations On Android - YouTube
Easy to follow tutorial on Turning off all vibrations on Android. Don't want your phone to vibrate at all? Learn how to disable...
Read more >AVPlayer does not sound if disabled audio / vibration
1 Answer 1 ... Doesn't work for me, my video is fine and the player is not muted and the volume is at...
Read more >Notifications: turn off sounds & vibrations - Google Support
To turn on/off and customize notification sounds & vibrations: Tap your profile picture . Tap Settings "" . Tap Notifications. Turn Disable sounds...
Read more >Play a sound on a device with Find Devices on iCloud.com
In Find Devices on iCloud.com, click All Devices, then select the device you want to play a sound on. If you don't see...
Read more >Android Phone Speakers Not Working? 7 Tips and Fixes to Try
Usually, you can resolve this bug with a standard reboot. But if that doesn't do the trick, you can try a free app,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Dallas62 Sorry for not giving a feedback, I have stopped using this library and wrote my proprietary native code.
Seems to be fix in
3.3.1
.