ios icon indicating copy to clipboard operation
ios copied to clipboard

Local notification action button click action not working when app is not running (App is killed)

Open Ravi448 opened this issue 4 years ago • 9 comments

Here is my code for creating rich notification

PushNotificationIOS.setNotificationCategories([
  {
    id: 'userAction',
    actions: [
      {
        id: 'dismiss',
        title: 'Dismiss',
        options: { foreground: false }
      },
      {
        id: 'snooz',
        title: 'Snooz',
        options: { foreground: false },
      },
    ],
  },
]);

Function for scheduling local notification

PushNotificationIOS.addNotificationRequest({
    fireDate: new Date(Date.now() + (5 * 1000)).toISOString(),
    title: "Hello Alarm",
    subtitle: "Wake up",
    body: "Some more description",
    sound: "Alarm.wav",
    category: "userAction",
    userInfo: {
      name: "Test",
      userId: "48932nmfe98ryhe9-oi32yrhfo"
    },
    id: new Date().toString(),
    threadId: "490uio3rji",
    repeats: "day"
  })

This is working fine when the app is running or is in background, but the action button does not work when the app is in dead state

My purpose is to display a notification for alarm and if user presses the snooz button, the notification should be re-scheduled doesn't matter whether the app is running or killed.

Ravi448 avatar Nov 02 '20 09:11 Ravi448

@Ravi448 I Am also facing the same issue did you find any solution to this issue?

Farhankhaliid avatar Dec 18 '20 22:12 Farhankhaliid

@Farhankhaliid I wrote the code in Native language (Swift & ObjC) and linked them to React Native. That was the only solution what I got

Ravi448 avatar Dec 24 '20 12:12 Ravi448

@Farhankhaliid I wrote the code in Native language (Swift & ObjC) and linked them to React Native. That was the only solution what I got

@Ravi448 can you please share your native code here .

ForamPattha avatar Jan 04 '21 06:01 ForamPattha

@Farhankhaliid I wrote the code in Native language (Swift & ObjC) and linked them to React Native. That was the only solution what I got

@Ravi448 can you please share the code here or approach you are using

Farhankhaliid avatar Jan 19 '21 21:01 Farhankhaliid

Any ideas on how to accomplish this? Same problem here.

cuttlas avatar Feb 07 '21 20:02 cuttlas

@Ravi448 Would be great to see how you managed to get it working on your end!

ninjz avatar Feb 24 '21 13:02 ninjz

@Farhankhaliid I wrote the code in Native language (Swift & ObjC) and linked them to React Native. That was the only solution what I got

@Ravi448 can you please share the code here or approach you are using

@Farhankhaliid I wrote the code in Native language (Swift & ObjC) and linked them to React Native. That was the only solution what I got

@Ravi448 can you please share the code here or approach you are using

@Farhankhaliid please share your solution

priyankagupta23pg avatar Jun 14 '21 05:06 priyankagupta23pg

Still, this library not supported the button click action when the app is in the killed state. Any other recommendations?

Farhankhaliid avatar Aug 21 '21 20:08 Farhankhaliid

Same here, looking for a solution for this problem!

MatthiasMuller avatar Jan 09 '22 22:01 MatthiasMuller