Skip to content
This repository was archived by the owner on Apr 7, 2026. It is now read-only.
This repository was archived by the owner on Apr 7, 2026. It is now read-only.

Android: Phone Calls- add AndroidFlags FLAG_ONGOING_EVENT #518

Closed

Description

@ice-cap0

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

Activity

  1. mikehardy commented on Sep 8, 2022

    @mikehardy
    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...)

  2. ice-cap0 commented on Sep 8, 2022

    @ice-cap0
    Author

    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

  3. ice-cap0 commented on Sep 8, 2022

    @ice-cap0
    Author

    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

  4. hadri3n commented on Nov 1, 2024

    @hadri3n

    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.

  5. mikehardy commented on Nov 1, 2024

    @mikehardy
    Collaborator

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

  6. hadri3n commented on Nov 1, 2024

    @hadri3n

    @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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions