react-native-notifications icon indicating copy to clipboard operation
react-native-notifications copied to clipboard

Fix API Documentation so that postLocalNotification works - Includes fix

Open UberMC opened this issue 2 years ago • 1 comments

I urgently suggest updating API so basic implementation works :) On page https://wix.github.io/react-native-notifications/docs/localNotifications

The fireDate requires it to be .toISOString(), new Date() is not sufficient


 let currentTime = new Date();
  let newTime = new Date(currentTime.getTime() + 10000); // Add 10 seconds
  let isoString = newTime.toISOString();

  

  Notifications.postLocalNotification({
    body: 'Local notification!',
    title: 'Local Notification Title',
    sound: 'chime.aiff',
    category: 'SOME_CATEGORY',
    link: 'localNotificationLink',
    fireDate: isoString
  }, 1);

The current example in API

let localNotification = Notifications.postLocalNotification({
    body: "Local notification!",
    title: "Local Notification Title",
    sound: "chime.aiff",
    silent: false,
    category: "SOME_CATEGORY",
    userInfo: { },
    fireDate: new Date(),
});

results in react-native-error Screenshot 2023-11-09 at 5 47 55 PM

UberMC avatar Nov 10 '23 01:11 UberMC

fireDate doesn't seem to be available in the latest version of the library. Any idea what happened to it?

patgoley-tts avatar Jun 04 '24 14:06 patgoley-tts

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

stale[bot] avatar Jan 31 '25 22:01 stale[bot]

The issue has been closed for inactivity.

stale[bot] avatar Feb 24 '25 23:02 stale[bot]