Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Android: Phone Calls- add AndroidFlags FLAG_ONGOING_EVENT #518

Closed
ice-cap0 opened this issue Sep 8, 2022 · 6 comments
Closed

Android: Phone Calls- add AndroidFlags FLAG_ONGOING_EVENT #518

ice-cap0 opened this issue Sep 8, 2022 · 6 comments

Comments

@ice-cap0
Copy link

ice-cap0 commented Sep 8, 2022

Still trying to get some form of incoming call working on Android

Currently using latest addition loopSound to get a ringtone to play on incoming call, works fine, except the notification dismisses itself in 3-4 secs

Could we also get FLAG_ONGOING_EVENT for AndroidFlags such that the notification remains heads-up until interacted with?

1- ongoing: true doesn't do anything (reproduced in stock rn app, similar issue here #450),
2- foregroundService doesn't work either. I read that it now takes 10 seconds to show, but even after 10 seconds, doesn't show. Android docs mention an exception for foregroundServiceType=phoneCall: https://developer.android.com/guide/components/foreground-services , but that doesn't work either
3- Fullscreen notifications have issues I mentioned earlier #501

I tried adding the constant value 2 for FLAG_ONGOING_EVENT in notification flags but it throws an error

@mikehardy
Copy link
Collaborator

an error

what error? Just curious - as with the other issues, more than happy to accept any PR that seems reasonable. It's not a use case I personally need (so I'm not motivated to personally author it, being honest) but it is one I would like to support (so I am motivated to collaborate in any way possible...)

@ice-cap0
Copy link
Author

ice-cap0 commented Sep 8, 2022

adding this to android object of displayNotification

flags: [2], // only works with Insistent (4)

getting

Error: notifee.displayNotification(*) 'notification.android.flags' invalid array value, expected an AndroidFlags value.

ref: https://developer.android.com/reference/android/app/Notification#FLAG_ONGOING_EVENT

@ice-cap0
Copy link
Author

ice-cap0 commented Sep 8, 2022

TBF this is a use case that is supposedly already addressed in the lib with the ongoing attribute, so this could be a bug rather than a feature request

EDIT: Looks like I misunderstood ongoing, which means "ongoing in the notification panel" rather than "persists as heads-up".
So my bad, no, not a bug, and seems FLAG_ONGOING_EVENT has the same behavior, which does not solve the persistent notification use case

Sorry for the confusion, closing this while looking for other options

@ice-cap0 ice-cap0 closed this as completed Sep 8, 2022
@hadri3n
Copy link

hadri3n commented Nov 1, 2024

TBF this is a use case that is supposedly already addressed in the lib with the ongoing attribute, so this could be a bug rather than a feature request

EDIT: Looks like I misunderstood ongoing, which means "ongoing in the notification panel" rather than "persists as heads-up". So my bad, no, not a bug, and seems FLAG_ONGOING_EVENT has the same behavior, which does not solve the persistent notification use case

Sorry for the confusion, closing this while looking for other options
Hi @frozencap,

Did you manage to have an persistent incoming call notification working ?
Cause I'm having a similar issue:
my notification is being moved to the "notifications shade" instead of staying on the foreground and visible, despite being associated with a foreground service, and being setup as ongoing.

@mikehardy
Copy link
Collaborator

@hadri3n you might like the work that happened this week --> #1134

@hadri3n
Copy link

hadri3n commented Nov 1, 2024

@hadri3n you might like the work that happened this week --> #1134

I may actually love it ! Thanks for pointing it out ! 🙏

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

No branches or pull requests

3 participants