react-native-push-notification / ios

React Native Push Notification API for iOS.
MIT License
740 stars 284 forks source link

scheduleLocalNotification fires immediately even though fireDate is of future #254

Open i1990jain opened 3 years ago

i1990jain commented 3 years ago

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);`
hassan-kiffgo commented 3 years ago

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

carbon

i1990jain commented 3 years ago

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

carbon

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.

isonlaxman commented 3 years ago

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 carbon

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

devinjameson commented 3 years ago

This might be helpful: https://github.com/react-native-push-notification-ios/push-notification-ios/issues/247