mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-04-23 11:36:13 +02:00
25 lines
597 B
Swift
25 lines
597 B
Swift
import UIKit
|
|
import WebKit
|
|
import Tauri
|
|
import SwiftRs
|
|
|
|
class NotificationPlugin: Plugin {
|
|
@objc public func requestPermission(_ invoke: Invoke) throws {
|
|
invoke.resolve(["permissionState": "granted"])
|
|
}
|
|
|
|
@objc public func permissionState(_ invoke: Invoke) throws {
|
|
invoke.resolve(["permissionState": "granted"])
|
|
}
|
|
|
|
@objc public func notify(_ invoke: Invoke) throws {
|
|
// TODO
|
|
invoke.resolve()
|
|
}
|
|
}
|
|
|
|
@_cdecl("init_plugin_notification")
|
|
func initPlugin(name: SRString, webview: WKWebView?) {
|
|
Tauri.registerPlugin(webview: webview, name: name.toString(), plugin: NotificationPlugin())
|
|
}
|