react-native-push-notification icon indicating copy to clipboard operation
react-native-push-notification copied to clipboard

What's the difference between `localNotificationSchedule` and `scheduleLocalNotification`?

Open pie6k opened this issue 6 years ago • 2 comments

I've just wasted an hour of debugging because I was using scheduleLocalNotification instead of localNotificationSchedule...

When I started to use localNotificationSchedule everything worked fine.

scheduleLocalNotification is inside codebase and typescript definition. (https://github.com/zo0r/react-native-push-notification/blob/6a6e9514c4bdd4d7182b3805785478f61a703088/index.js#L287)

Why is this different method even there?

pie6k avatar Dec 28 '19 23:12 pie6k

If you look at localNotificationSchedule https://github.com/zo0r/react-native-push-notification/blob/6a6e9514c4bdd4d7182b3805785478f61a703088/index.js#L156

You can see it does some platform specific stuff, like getting the date in the right format for each platform, before calling scheduleLocalNotification with the platform specific details object. If you call scheduleLocalNotification directly, some of the properties on your notification details object, like the date, won't be in the right format.

nate-whil avatar Feb 04 '20 19:02 nate-whil

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 30 days if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Feb 04 '21 00:02 github-actions[bot]