.github
android
api
assets
debian
drift_schemas
ios
Flutter
Runner
Assets.xcassets
Base.lproj
Data
Service
AppDelegate.swift
AppIntent.swift
GoogleService-Info.plist
Info.plist
NotifyDelegate.swift
Runner-Bridging-Header.h
Runner.entitlements
Runner.xcodeproj
Runner.xcworkspace
RunnerTests
SolarNotifyService
SolarShare
SolarWidget
.gitignore
Podfile
Podfile.lock
SolarWidgetExtension.entitlements
lib
linux
macos
snap
test
web
windows
.gitignore
.metadata
.roadsignrc
README.md
analysis_options.yaml
build.yaml
devtools_options.yaml
firebase.json
pubspec.lock
pubspec.yaml
roadsign.toml
40 lines
850 B
Swift
40 lines
850 B
Swift
//
|
|
// AppIntent.swift
|
|
// Runner
|
|
//
|
|
// Created by LittleSheep on 2024/12/21.
|
|
//
|
|
|
|
import AppIntents
|
|
import Flutter
|
|
import Foundation
|
|
import home_widget
|
|
|
|
@available(iOS 17, *)
|
|
public struct AppBackgroundIntent: AppIntent {
|
|
static public var title: LocalizedStringResource = "Solar Network Background Intent"
|
|
|
|
@Parameter(title: "Widget URI")
|
|
var url: URL?
|
|
|
|
@Parameter(title: "AppGroup")
|
|
var appGroup: String?
|
|
|
|
public init() {}
|
|
|
|
public init(url: URL?, appGroup: String?) {
|
|
self.url = url
|
|
self.appGroup = appGroup
|
|
}
|
|
|
|
public func perform() async throws -> some IntentResult {
|
|
await HomeWidgetBackgroundWorker.run(url: url, appGroup: appGroup!)
|
|
|
|
return .result()
|
|
}
|
|
}
|
|
|
|
@available(iOS 17, *)
|
|
@available(iOSApplicationExtension, unavailable)
|
|
extension AppBackgroundIntent: ForegroundContinuableIntent {}
|