tauri-apps / tauri-apps/plugins-workspace
Notification schedule doesn't properly handle timezone on ios
- Dominant language
- Rust
- Stars
- 1.8k
- Forks
- 602
- Avg merge
- 4d 14h
- Merged PRs (30d)
- 9
Description
### Describe the bug
Notifications doesnt seem to properly handle timezone on iOS. On Android, if I schedule a notification in 10 seconds it works properly, but on iOS I need to manually add the timezone for it to work. If I'm at GMT+1, I need to add one hour.
According to apple documentation you need to specify the timezone : https://developer.apple.com/documentation/foundation/dateformatter#Working-With-Fixed-Format-Date-Representations
But it doesnt seem to be the case in the plugin, adding this line should fix it:
### Reproduction
You could fix it by manually adding the timezone when calling the notification:
```ts
sendNotification({
body,
title,
// Sends notification in 1 second even though I'm adding 1 jour
schedule: Schedule.at(new Date(Date.now() + 1000 + 60 * 60 * 1000), false, true),
});
```
### Expected behavior
Calling the `sendNotification` function by adding 1 second to the current time should trigger the notification in 1 second:
```ts
sendNotification({
body,
title,
// Sends notification in 1 second
schedule: Schedule.at(new Date(Date.now() + 1000), false, true),
});
```
### Full `tauri info` output
```text
[✔] Environment
- OS: Mac OS 26.2.0 arm64 (X64)
✔ Xcode Command Line Tools: installed
✔ Xcode: 26.2
✔ rustc: 1.91.0 (f8297e351 2025-10-28)
✔ cargo: 1.91.0 (ea2d97820 2025-10-10)
✔ rustup: 1.28.2 (e4f3ad6f8 2025-04-28)
✔ Rust toolchain: stable-aarch64-apple-darwin (default)
- node: 22.14.0
- pnpm: 10.26.0
- yarn: 1.22.21
- npm: 10.9.2
- bun: 1.0.35
[-] Packages
- tauri 🦀: 2.10.1, (outdated, latest: 2.10.2)
- tauri-build 🦀: 2.5.4, (outdated, latest: 2.5.5)
- wry 🦀: 0.54.1
- tao 🦀: 0.34.5
- @tauri-apps/api ⱼₛ: 2.10.1
- @tauri-apps/cli ⱼₛ: 2.10.0
[-] Plugins
- tauri-plugin-opener 🦀: 2.5.3
- @tauri-apps/plugin-opener ⱼₛ: 2.5.3
- tauri-plugin-notification 🦀: 2.3.3
- @tauri-apps/plugin-notification ⱼₛ: 2.3.3
[-] App
- build-type: bundle
- CSP: unset
- frontendDist: ../build
- devUrl: http://localhost:1420/
- framework: Svelte
- bundler: Vite
[-] iOS
- Developer Teams: EOLE (ID: 24PM95Z9S4), Jeremie Taboada (ID: Z633EZ6TRQ)
```
### Stack trace
```text
If I simply add 1 second, there would be this error (which make sense because the timezone is not properly set):
Unhandled Promise Rejection: tauri_plugin_notification.ShowNotificationError.create(tauri_plugin_notification.NotificationError.pastScheduledTime)
```
### Additional context
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.