react-native-notifications
react-native-notifications copied to clipboard
Fix API Documentation so that postLocalNotification works - Includes fix
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
fireDate doesn't seem to be available in the latest version of the library. Any idea what happened to it?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
The issue has been closed for inactivity.