Skip to content
This repository has been archived by the owner on Jan 14, 2025. It is now read-only.

Fix for vibration on notifs for Android API >= 26 #1686

Merged
merged 3 commits into from
Oct 20, 2020
Merged

Fix for vibration on notifs for Android API >= 26 #1686

merged 3 commits into from
Oct 20, 2020

Conversation

mineshpatel1
Copy link

This fixes the vibration feature for notification for Android notifications for API >= 26. This pattern is used for the Notif Builder for API < 26 and it appears to work there as well.

Before:

<Sending Notif>
2020-10-04 12:37:03.630 1936-29464/? E/VibratorService: vibratorOff command failed (1).
2020-10-04 12:37:03.935 1936-29476/? E/VibratorService: vibratorOff command failed (1).

After:

<Sending Notif>
2020-10-04 12:07:16.037 1936-4760/? E/VibratorService: vibratorOff command failed (1).
2020-10-04 12:07:16.037 1936-4760/? E/VibratorService: vibratorOn command failed (1).
2020-10-04 12:07:16.438 1936-1936/? E/VibratorService: vibratorOff command failed (1).

Have tested this on a physical device as well and it works. This could lead to an obvious extension which is for users to specify a vibration pattern array when creating a channel.

Dallas62 and others added 2 commits October 3, 2020 12:15
…ations for API >= 26. This pattern is used for the Notif Builder for API < 26 and it appears to work there as well.

Before:

```
<Sending Notif>
2020-10-04 12:37:03.630 1936-29464/? E/VibratorService: vibratorOff command failed (1).
2020-10-04 12:37:03.935 1936-29476/? E/VibratorService: vibratorOff command failed (1).
```

After:
```
<Sending Notif>
2020-10-04 12:07:16.037 1936-4760/? E/VibratorService: vibratorOff command failed (1).
2020-10-04 12:07:16.037 1936-4760/? E/VibratorService: vibratorOn command failed (1).
2020-10-04 12:07:16.438 1936-1936/? E/VibratorService: vibratorOff command failed (1).
```

Have tested this on a physical device as well and it works. This could lead to an obvious extension which is for users to specify a vibration pattern array when creating a channel.
@Dallas62
Copy link
Collaborator

Dallas62 commented Oct 4, 2020

Thanks for the PR!
I will take a look at this ASAP!
Regards

@mineshpatel1
Copy link
Author

@Dallas62 - Bump, I think there's still value in landing this one.

@mineshpatel1
Copy link
Author

@Dallas62 - Hi, would you be able to review this pull request please? Just making sure it's not been forgotten about, it's just a little one (but an important fix for newer versions of Android).

@Dallas62
Copy link
Collaborator

Hi,
I will check this PR ASAP (holidays)
Regards

@juancabrera
Copy link

@mineshpatel1 thanks for the fix, made the change manually on my local and works as expected!

@Dallas62
Copy link
Collaborator

Hi,
This line should probably be updated too:

@Dallas62 Dallas62 changed the base branch from master to dev October 20, 2020 21:58
@Dallas62 Dallas62 merged commit 795c64c into zo0r:dev Oct 20, 2020
@Dallas62
Copy link
Collaborator

Forget my last comment/commit, reverted, was tired 😄
You will find this in the 6.1.2, and I also test on real device and simulator.

You may encounter this bug in old version if the channel is already created.

Two options:

  • Delete then recreate the channel.
  • Change the channel id to ensure this is the correct settings (and remove the old one if needed)

@cristianoccazinsp
Copy link
Contributor

Heads up, this only seems to work if the channel is re-created / full app re-install.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants