Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AbdulmalekZainHC
Copy link

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

  • Integrated SiriKit to handle voice commands within the app.
  • Added Intents for key app functionalities to be used with Siri and Shortcuts.
  • Updated the app’s Info.plist to include necessary permissions and configurations for Siri integration.
  • Implemented Shortcut actions for quick access to specific app features.

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 .

@abdulmalekc1
Copy link

?????

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: ""))
Copy link
Member

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")
Copy link
Member

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"
Copy link
Member

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 {
Copy link
Member

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>
Copy link
Member

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>
Copy link
Member

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants