Closed mattbarker016 closed 5 years ago
Slack me with any questions or anything!
Update: We are going to create a Ithaca-transit://
URL scheme that takes in parameters used to calculate routes. The IntentHandler will use this to keep client implementation details from the Siri extension, and serves as a way to continue to develop the app's extensibility. Yana is on top of this, just updating this for posterity.
Goal
Using the below methods, create a way to allow users to engage with their favorite routes using Siri.
We want to suggest Ithaca Transit routes contextual using time and location with the help of Siri, and as a bonus, be able to use Siri to select a route and start the app flow.
Here is the starting point for the SiriKit documentation. It's not the most well-structured, so if you get a bit lost in it, it's always helpful to start back here. I've included more specific links throughout this issue, too.
Tasks
0. Create a URL scheme for the app.
ithaca-transit://getRoutes?...
The parameters should be everything needed to open
RouteOptionsViewContoller
and performNetwork.getRoutes(...)
. Withinapplication(_ application: UIApplication, open url: URL, ...)
in theAppDelegate
, you will handle re-creating the navigation stack and starting the requests.Resources AppCode Guide Apple Documentation
A Note We may want to create some simple documentation now that the iOS app has its own API. Exciting! Or extra work... eh I think it's kinda cool. But actually, if our other apps or student projects want to integrate with our solution, I'd love to have some documentation for it. It will make us look much more legitimate and standard with our competitors too!
1. Donate shortcuts for user searches
Donate an interaction documentation.
Instructions
Create New Target: File > New > Target IntentExtension Modify
Intents.intentdefinition
: You can create this file by going to File > New > File > Resource > SiriKit Intent Definition File. Open it, click the "+" button in the bottom left corner to create one and define values. Create Intent Handler ClassesUsing these classes and functions, add the donation code within the app once we have the relevant information (somewhere in Route Options). The code will look something like this:
2. Define relevant shortcuts based on time and location
Instructions
Follow the documentation here.
Relevant Classes
Important Note
Suggesting a shortcut is different from donating. From this page:
We don't want to do this presently: it's not very discoverable and we'd have to write more code to transition from suggested to donated.