ios
ios copied to clipboard
scheduleLocalNotification fires immediately even though fireDate is of future
I am creating a scheduleLocalNotification request, which I intend to fire after 7 days and repeat every week, in the following way but this notification is shown as soon as the code is executed, even though fireDate is of the future
`const request = {
userInfo: { id: '1' },
alertTitle: "TItle Text",
alertBody: "body text.",
fireDate: new Date(Date.now() + 604800000),
repeatInterval: 'week',
}
PushNotificationIOS.scheduleLocalNotification(request);`
Use PushNotificationIOS.addNotificationRequest(notification) instead of PushNotificationIOS.scheduleLocalNotification(request) since scheduleLocalNotification in deprecated. https://github.com/react-native-push-notification-ios/push-notification-ios#schedulelocalnotification
Use PushNotificationIOS.addNotificationRequest(notification) instead of PushNotificationIOS.scheduleLocalNotification(request) since scheduleLocalNotification in deprecated. https://github.com/react-native-push-notification-ios/push-notification-ios#schedulelocalnotification
I updated to the latest version and addNotificationRequest does not fire at all if a fireDate is mentioned in the passed object. fires instantly when there is no fireDate object.
Use PushNotificationIOS.addNotificationRequest(notification) instead of PushNotificationIOS.scheduleLocalNotification(request) since scheduleLocalNotification in deprecated. https://github.com/react-native-push-notification-ios/push-notification-ios#schedulelocalnotification
I updated to the latest version and addNotificationRequest does not fire at all if a fireDate is mentioned in the passed object. fires instantly when there is no fireDate object.
same issue as this. addNotificationRequest does nothing if the fire date is in the future but works if I don't set a fireDate
This might be helpful: https://github.com/react-native-push-notification-ios/push-notification-ios/issues/247