Search code examples
androidreact-nativenotificationsstickyforeground

Want to implement sticky local notification in React Native for Android


Is there any way to keep a notification for an app stick to the lockscreen and notifications pull down in Android regardless the state of the application (running or killed) for example the Weather Channel App. But in react native.

I also want to have a custom notification with action buttons if its possible.


Solution

  • Use React native push notifications

    If you want to make it sticky and needs custom actions, you can set like below

    PushNotification.localNotification({
        ongoing:true,
        actions: '["Yes", "No"]'
    })
    

    Check Custom action handling to handle your custom actions