Repository: tauri
Issue: [feat] Push Notifications
Labels: type: feature request

### Describe the problem

Several platforms supported by Tauri - macOS, iOS, and Android, to name a few - have some kind of built-in push notifications system. For Apple systems, of course there is [APNS](https://developer.apple.com/documentation/usernotifications/registering-your-app-with-apns), and for Android and Firebase-enabled apps, there is [FCM](https://firebase.google.com/docs/cloud-messaging).

Tauri isn't yet able to support these APIs, as far as I can tell. On Apple platforms, the developer must [register a method with the `AppDelegate` and call a method on `NSApplication`](https://developer.apple.com/documentation/usernotifications/registering-your-app-with-apns), which isn't easy to do from Rust. iOS uses a similar flow, but with `UIApplication` instead.

Push Notifications are likely to be a common need for Tauri developers, especially on mobile platforms.

### Describe the solution you'd like

I think Tauri should add calls to the `UIApplication` and/or `NSApplication` to register for push notification support on behalf of the developer; or, Tauri should make available such calls so the developer can implement support themselves.

### Alternatives considered

1) I looked for plugins and found none
2) I looked for easy Rust bindings to register for APNS, and found none because these APIs use `{NS,UI}Application`
3) I looked into alternative push systems (3rd-party), but these aren't integrated well with underlying operating systems like Android and iOS, as compared to native push infrastructure

### Additional context

### General support

In most cases, "registering" for these push systems consists of a few relatively simple steps:

1) "Registering" or "requesting" a token from the application, using system APIs, potentially within the app entrypoint
2) "Receiving" the token via some callback or delegate mechanism (the token is typically just some raw bytes or a string)
3) Making the received token available to the developer
  - Usually the developer will want to send this token to a server
  - Callbacks or even just a method to retrieve the latest push token (if any) would work fine for callers, probably

### Apple Platforms

**macOS**

It looks like [`tao` already sets up an `AppDelegate`](https://github.com/tauri-apps/tao/blob/88f0b4190f77d215f13e88f826c6b5bf06cafe57/src/platform_impl/macos/app_delegate.rs#L103-L107), where we would need to call [`registerForRemoteNotifications`](https://developer.apple.com/documentation/appkit/nsapplication/2967172-registerforremotenotifications), and then receive the token at the delegate method [`application(_:didRegisterForRemoteNotificationsWithDeviceToken:)`](https://developer.apple.com/documentation/appkit/nsapplicationdelegate/1428766-application).

**iOS**

Nearly identical to macOS, but with [`UIApplication.registerForRemoteNotifications()`](https://developer.apple.com/documentation/uikit/uiapplication/1623078-registerforremotenotifications) and [the equivalent delegate method](https://developer.apple.com/documentation/uikit/uiapplicationdelegate/1622958-application).

### Android

Firebase uses a `Service` on Android to implement messaging within an app. This service is declared in the `AndroidManifest.xml` and then implemented within app code; the service:

- Requests a token
- Receives the token/receives updated tokens
- Receives pushed messages directed to the app

This would be implemented in Kotlin as part of an Android mobile plugin for Tauri. Luckily there are no changes anticipated for `tao` or `tauri` itself; Android push can happen through the plugin alone.

### Windows

Windows apparently has [Windows Notifications System (WNS)](https://learn.microsoft.com/en-us/windows/apps/windows-app-sdk/notifications/push-notifications/push-quickstart), which is accessible via the [`windows`](https://microsoft.github.io/windows-docs-rs/doc/windows/?search=PushNotifications) crate. So far it appears to function similar to Android, in that a library can obtain a push channel without special code in the app entrypoint.

### Linux

I'm not aware of native push infrastructure for Linux. Other SDKs can be used on Linux which do not require instrumentation in the app entrypoint.