question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Disabling vibrate and playSound doesn't work

See original GitHub issue

Bug

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

  1. Invoke PushNotification.localNotification function with proper parameters (listed below)
  2. Observe that the phone plays sound and vibrates.

Describe what you expected to happen:

  1. 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:closed
  • Created 3 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
VictorAtPLcommented, May 2, 2020

@Dallas62 Sorry for not giving a feedback, I have stopped using this library and wrote my proprietary native code.

0reactions
Dallas62commented, May 2, 2020

Seems to be fix in 3.3.1.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found