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.

vibrate: false is ignored

See original GitHub issue

Hi,

my settings disabling to vibrate function, but on each notification my device are still vibrating. It is a bug in your lib or have I a misconfiguration?

“react-native”: “^0.58.6” “react-native-push-notification”: “^3.1.3”

test-device: huawai p10 lite android: 8.0.0

my settings: `localNotif(message, item) { PushNotification.localNotification({ /* Android Only Properties */ id: ‘1’, autoCancel: true, largeIcon: “ic_launcher”, smallIcon: “ic_notification”, bigText: message, vibrate: false, // (optional) default: true vibration: 0, // vibration length in milliseconds, ignored if vibrate=false, default: 1000 itemData: item,

        /* iOS only properties */
        alertAction: 'view', 
        category: null, 
        userInfo: null, 

        /* iOS and Android properties */
        title: Localization('General.Download.DownloadTitle'), // (optional)
        message: message, // (required)
        playSound: false, // (optional) default: true
        soundName: 'default', 
        number: '10', 
        // actions: '["Yes", "No"]',  
    });
}`

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:11
  • Comments:21 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
necto68commented, Sep 5, 2019

This is a bug in Android 8+. You can fix it in RNPushNotificationHelper.java.

long vibration = bundle.containsKey("vibration") ? (long) bundle.getDouble("vibration") : DEFAULT_VIBRATION;
        long[] vibratePattern = (bundle.containsKey("vibrate") && bundle.getBoolean("vibrate")) ? new long[]{0, vibration} : new long[]{ 0 };

        channel.setDescription(this.config.getChannelDescription());
        channel.enableLights(true);

        channel.setVibrationPattern(vibratePattern);
        channel.enableVibration(true);

        manager.createNotificationChannel(channel);
        channelCreated = true;

Add this at the end of the file.

2reactions
Dallas62commented, May 1, 2020

We tried out the new release and unfortunately it made all our notifications the silent kind that appear minimized at the bottom of the notification tray (and they’re only visible when you open the notification tray). 😦

If working with that other library is the best option, do we have code they could use for scheduled notifications?

Sorry for this issue, I fixed it on 3.3.1.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Notification vibrate issue for android 8.0 - Stack Overflow
This is a bug on Android 8 notification system. I've tinkered with different combinations of enableVibration with setVibrationPattern(null) ...
Read more >
Google Messages is ignoring Pixel 4a phone vibration settings
I have notification vibration turned off for the entire device (Pixel 4a), as in screenshot below. Messages still vibrates. I saw in the ......
Read more >
Navigator.vibrate() - Web APIs | MDN
The Navigator.vibrate() method pulses the vibration hardware on the device, if such hardware exists. If the device doesn't support vibration ...
Read more >
core/java/android/os/Vibrator.java - platform/frameworks/base
* Check whether the vibrator has amplitude control. *. * @return True if the hardware can control the amplitude of the vibrations, otherwise...
Read more >
cordova-plugin-vibration
Calls to navigator.vibrate will immediately return false if user hasn't tapped on the frame or any embedded frame yet. Please checkout https://issues.apache ...
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