EddyVerbruggen / nativescript-local-notifications

:mailbox: NativeScript plugin to easily schedule local notifications
MIT License
162 stars 57 forks source link

custom data not passed on iOS #188

Open felixkrautschuk opened 4 years ago

felixkrautschuk commented 4 years ago

When scheduling a local notification like this:

LocalNotifications.schedule(
        [{
          id: 1,
          title: 'Title',
          body: 'This is a message',
          forceShowWhenInForeground: true,
          customData: {
                idStory: "1234",
                titleStory: "This is the title"
          }
}]).then(() => {
          alert({
            title: "Notification scheduled",
            message: 'ID: 1',
            okButtonText: "OK, thanks"
          });
});

(note the customData object) ...

I want to get this data when the notification has been clicked.

LocalNotifications.addOnMessageReceivedCallback(notificationData => {
      console.log("Notification received: " + JSON.stringify(notificationData));
});

But here, I only get id, title, body, foreground and event on iOS.

On Android, I get the whole object that I've passed within the schedule method, so even customData can be accessed.

My config:

phoenix503 commented 4 years ago

@felixkrautschuk you got any solution on this issue? I am looking for the same

lifo-linxuanli commented 3 years ago

Any update on this issue?

smujaddid commented 3 years ago

Need this too. Any update?