-
-
Notifications
You must be signed in to change notification settings - Fork 317
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Integrate Siri shortcuts to enable/disable gps tracking #82
base: master
Are you sure you want to change the base?
Integrate Siri shortcuts to enable/disable gps tracking #82
Conversation
????? |
let userDefaults = UserDefaults.standard | ||
if !userDefaults.bool(forKey: "service_status_preference") { | ||
userDefaults.setValue(true, forKey: "service_status_preference") | ||
await StatusViewController.addMessage(NSLocalizedString("Tracking Service created", comment: "")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's reuse existing string
trackingController = TrackingController() | ||
trackingController?.start() | ||
} | ||
return .result(dialog: "Tracking Service Started") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be localized as well. And probably reuse string as well.
@available(iOS 16, *) | ||
struct StartTrackingIntent: AppIntent { | ||
|
||
static let title: LocalizedStringResource = "Start Tracking Service" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And this
import SwiftUI | ||
|
||
@available(iOS 16, *) | ||
struct StopTrackingIntent: AppIntent { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same for strings here.
<key>INIntentConfigurable</key> | ||
<true/> | ||
<key>INIntentDescription</key> | ||
<string>starts tracking with gps</string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is a correct description. It doesn't necessarily use GPS. Also need proper letter cases
</dict> | ||
</dict> | ||
<key>INIntentName</key> | ||
<string>StartTrackingService</string> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this file I only see the start track intent. Where is the stop defined?
Description
This pull request adds Siri and Shortcuts integration to the app, enhancing the user experience by enabling voice commands and quick actions. My main goal was to enable/disable the GPS tracking service using automations (eg. when i start driving)
Changes
Testing
Unfortunately due to the Siri integration requiring a paid Apple Developer Account, i was not able to test this outside of the simulator, where everything works perfectly .