Skip to content

local-notifications: On iOS, scheduled notifications do not respect timezone changes #2361

Open
@gregzo

Description

@gregzo

Bug Report

Plugin(s)

@capacitor/local-notifications 7.0.1

Platform(s)

iOS, macOS
Android untested

Current Behavior

In LocalNotificationsPlugin.swift, the method handleScheduledNotification instantiates the notification trigger for at punctual notifications using UNTimeIntervalNotificationTrigger. For this to work, the requested at date is first converted to a date interval from now. The result is that the notification will fire at a fixed interval in the future, regardless of the timezone which the user is in.

Expected Behavior

If there are no repeats, on notifications should result in a UNCalendarNotificationTrigger trigger with repeat: false. That way, the scheduled notification should respect timezone changes so that a notification scheduled for 8am whilst in London doesn't fire at 2am in New York.

Edited: removed erroneous mention of UNTimeIntervalNotificationTrigger

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions