react-native-push-notification / ios

React Native Push Notification API for iOS.
MIT License
741 stars 285 forks source link

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

Open Ravi448 opened 3 years ago

Ravi448 commented 3 years ago

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.

Farhankhaliid commented 3 years ago

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

Ravi448 commented 3 years ago

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

ForamPattha commented 3 years ago

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

Farhankhaliid commented 3 years ago

@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

cuttlas commented 3 years ago

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

ninjz commented 3 years ago

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

priyankagupta23pg commented 3 years ago

@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

Farhankhaliid commented 3 years ago

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

MatthiasMuller commented 2 years ago

Same here, looking for a solution for this problem!