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

Android API 26+ fixed heads-up notifications #849

Closed
wants to merge 1 commit into from
Closed

Conversation

btav
Copy link

@btav btav commented Aug 27, 2018

Starting in Android API 26+ the notification channel needs high importance in order to display heads-up notifications. We upgraded our app from target API 22 to 27 and noticed that the heads-up notifications no longer worked for our local notifications. In this pull-request, I just changed the NotificationChannel importance to high instead of default. This resolved the issue.

Please review the heads-up notification section.
https://developer.android.com/guide/topics/ui/notifiers/notifications

@senne-af
Copy link

From the documentation you linked:

  • Urgent: Makes a sound and appears as a heads-up notification.
  • High: Makes a sound.
  • Medium: No sound.
  • Low: No sound and does not appear in the status bar.

So I think you need to set it to urgent instead of high.

@vmary2014
Copy link

I would have thought this need parameterized but for my own use this change would be perfect ;o)

@btav
Copy link
Author

btav commented Aug 28, 2018

@sennevc I have only tested using the high channel importance and it worked. Sorry for any confusion but I meant this part of the documentation.

screenshot at aug 28 10-45-00

@vmary2014 Good idea, adding a parameter for the channel importance might be a better solution. I can most certainly look into doing this change and updating the documentation. Im just going to wait for one of the maintainers/collaborators to review and give us their thoughts.

@senne-af
Copy link

Whoops, my bad! I confused two parts of the documentation. ¯\_(ツ)_/¯

@Gp2mv3
Copy link
Contributor

Gp2mv3 commented Aug 31, 2018

Shouldn't the importance be a parameter per notification ? (In the payload)

@Gp2mv3
Copy link
Contributor

Gp2mv3 commented Aug 31, 2018

PR #854 does exactly what I suggested below. Thus I close this one.

@Gp2mv3 Gp2mv3 closed this Aug 31, 2018
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