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.

Android - Vibration not working?

See original GitHub issue

Bug

Vibration does not work with the following code:

PushNotification.createChannel(
  {
    channelId: "com.tenantmovein.notifications", // (required)
    channelName: "TMI Notifications", // (required)
    channelDescription: "TMI notifications.", // (optional) default: undefined.
    soundName: "default", // (optional) See `soundName` parameter of `localNotification` function

    // (optional) default: 4. Int value of the Android notification importance
    // make it match calls to .localNotification priority
    importance: 4,
    vibrate: true, // (optional) default: true. Creates the default vibration patten if true.
  },
  (created) => console.log(`createChannel returned '${created}'`) // (optional) callback returns whether the channel was created, false means it already existed.
);
PushNotification.localNotification({
  /* Android Only Properties */
  id: id,
  channelId: "com.tenantmovein.notifications",
  autoCancel: true,
  vibrate: true,
  vibration: 1000,
  priority: "high",
  visibility: "public",

  /* iOS only properties */
  //alertAction: 'view',
  userInfo: {id: id}, // required for ios local notification

  /* iOS and Android properties */
  title: title,
  message: message, // (required)
  playSound: sound,
  soundName: sound ? 'default' : undefined,
  // number: number // silly library, iOS requires number, while android string...

});
<uses-permission android:name="android.permission.VIBRATE" />

Environment info

react-native info output:

info Fetching system and libraries information...
System:
    OS: macOS 10.15.7
    CPU: (4) x64 Intel(R) Core(TM) i5-6267U CPU @ 2.90GHz
    Memory: 1.01 GB / 8.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 12.16.3 - /usr/local/bin/node
    Yarn: 1.22.5 - /usr/local/bin/yarn
    npm: 6.14.8 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.9.1 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 14.0, DriverKit 19.0, macOS 10.15, tvOS 14.0, watchOS 7.0
    Android SDK:
      API Levels: 23, 26, 28, 29
      Build Tools: 28.0.3, 29.0.2
      Android NDK: Not Found
  IDEs:
    Android Studio: 4.0 AI-193.6911.18.40.6626763
    Xcode: 12.0.1/12A7300 - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_121 - /usr/bin/javac
    Python: 2.7.15 - /Library/Frameworks/Python.framework/Versions/2.7/bin/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.13.1 => 16.13.1 
    react-native: 0.62.2 => 0.62.2 
  npmGlobalPackages:
    *react-native*: Not Found

Library version: 6.1.1

Steps To Reproduce

See code above

Describe what you expected to happen:

Notifications should also include vibration.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
willedanielssoncommented, Jan 11, 2021

@Dallas62 Since the PR has been merged etc, I think you all can close this issue 👍

0reactions
mineshpatel1commented, Oct 14, 2020

It is from my point of view, need one of the repository maintainers to sign off on it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Top 8 Ways to Fix Vibration Not Working on Android - TechWiser
Open the Settings app and navigate to Sound. · Tap on Vibrate for calls and select Always vibrate. · Now head back to...
Read more >
Phone vibration not working! Try these quick fixes! - Carlcare
Phone vibration not working! Try these quick fixes! · Just Reboot Your Phone · Run a Vibration Test · Turn on Vibration on...
Read more >
Top 10 Fixes for Vibration Not Working in Samsung Galaxy ...
1. Restart Phone · 2. Enable Vibration · 3. Change Vibration Pattern and Intensity · 4. Check Individual App Settings · 5. Uninstall...
Read more >
[Working] Top 10 Ways to Fix Vibrations Not Working on Android
Ways to Fix Vibrations Not Working on Android · 1. Open the settings app and scroll down to open App Management. · 2....
Read more >
Vibration Not Working On My Samsung Phone - How To Fix It
What to do when vibration is not working on a Samsung Phone · Soft Reset your phone. · Ensure your phone is not...
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