Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

custom data not passed on iOS #188

Open
felixkrautschuk opened this issue Mar 20, 2020 · 3 comments
Open

custom data not passed on iOS #188

felixkrautschuk opened this issue Mar 20, 2020 · 3 comments

Comments

@felixkrautschuk
Copy link

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:

  • @nativescript/core 6.5.0
  • tns-android, tns-ios 6.5.0
  • nativescript-local-notifications 4.2.0
@phoenix503
Copy link

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

@lifo-linxuanli
Copy link

Any update on this issue?

@smujaddid
Copy link

Need this too. Any update?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants