react-native-push-notification / ios

React Native Push Notification API for iOS.
MIT License
749 stars 286 forks source link

Make option for local notifications to be timezone independant #188

Open tdekoning opened 4 years ago

tdekoning commented 4 years ago

Feature request

Right now, it is possible to schedule a local notification in the future. However, when the user travels between time zones (or when daylight savings occurs), the notification will be based off the old time zone.

Since there is no way to act upon time zone changes in the background on iOS, it would be awesome if there would be an option to specify that the notification occurs on a specific time on a specific day, independently of the time zone the user is in.

Why it is needed

We have to schedule local notifications for users to be reminder to do a certain physical action. This action relies on the daily routine of the user, which will change based on the time zone the user is in.

Possible implementation

I'm not an iOS user or expert, but i can imagine it would be using the https://developer.apple.com/documentation/usernotifications/uncalendarnotificationtrigger class to specify when the notification should be shown.

Code sample

bwernsman commented 2 years ago

I created a PR for this, https://github.com/react-native-push-notification/ios/pull/354. Feel free to take a look!