Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Can't set priority for Android heads-up notification #114

Closed
rchisholm opened this issue Sep 11, 2018 · 6 comments
Closed

Can't set priority for Android heads-up notification #114

rchisholm opened this issue Sep 11, 2018 · 6 comments

Comments

@rchisholm
Copy link

Hello,

Thank you so much for this plugin. It is has been very helpful for my app's purposes, where push notifications would have been overkill.

However, I find that I am unable to create heads-up notifications. There is no "priority" property, as referenced in issue #98, and I see that heads-up notifications are referenced in issue #69, however this issue recommends using the property "forceShowWhenInForeground" to true, which does not create a heads-up notification (though it does create a regular notification while the app is in the foreground).

Any help would be greatly appreciated. Thanks again!

@EddyVerbruggen
Copy link
Owner

Can you educate me on what a 'heads-up' notification is, and how it's different from one that shows in the foreground (because that's what I thought was meant).

@rchisholm
Copy link
Author

From developer.android.com

Heads-up notification
Beginning with Android 5.0, notifications can briefly appear in a floating window called a heads-up notification. This behavior is normally for important notifications that the user should know about immediately, and it appears only if the device is unlocked.

heads-up_2x

Figure 3. A heads-up notification appears in front of the foreground app

The heads-up notification appears the moment your app issues the notification and it disappears after a moment, but remains visible in the notification drawer as usual.

For me, when using the option "forceShowWhenInForeground," the notification displays in the standard notification drawer while the app is in the foreground, but doesn't show the notification in the foreground, if that makes any sense. The heads-up notification needs to show as a floating window with text (like the default notifications in iOS), not just an icon in the notification drawer, which then shows the notification text and icon when dragged down (like default notifications in Android).

@Lehren
Copy link

Lehren commented Nov 8, 2019

Any update? Would be useful to have this available.

@EddyVerbruggen
Copy link
Owner

@Lehren The main problem is that I'm not entirely sure about the implementation. Would it suffice to expose a priority property which takes a number and is passed to this line?

@Lehren
Copy link

Lehren commented Nov 10, 2019

@EddyVerbruggen
For me that would be fine if possible.

@EddyVerbruggen
Copy link
Owner

Alright, available now in 4.1.2. See the readme (look for priority).

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

3 participants