-
Notifications
You must be signed in to change notification settings - Fork 57
Add CarPlay Stadia Search #654
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
base: main
Are you sure you want to change the base?
Conversation
- `DemoCarPlaySearch` -> this can actually go into the api-search repository. It is designed not to have external dependencies.
| do { | ||
| if self.searchText != searchText { | ||
| self.searchText = searchText | ||
| try await search(query: searchText, autocomplete: false) |
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 only ever be false when the user indicates they are finished searching (i.e. pressing the search button on the on-screen keyboard).
It looks like it's false only to get the full place details with every search, but in doing so, the results will actually be quite a bit worse on partial input (all of the input on mobile :P).
Ideally we'd fetch the details on selection. If that's not possible, lemme know and I've got some other ideas.
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 only ever be
falsewhen the user indicates they are finished searching (i.e. pressing the search button on the on-screen keyboard).It looks like it's
falseonly to get the full place details with every search, but in doing so, the results will actually be quite a bit worse on partial input (all of the input on mobile :P).Ideally we'd fetch the details on selection. If that's not possible, lemme know and I've got some other ideas.
I don't have an async context to get the details once Search is pressed. So it cannot request the details then...
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.
FYI, if it helps, the only detail missing is the lat/lng. The rest are superfluous for "I need a search destination".
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.
Sorry for the delay in responding to this, but I just had a deeper look and it seems like, while there isn't a "swifty" async context, you can indeed do async operations (in this case, calling the place details endpoint with the selected item ID).
CarPlay executes your handler on the main queue. You must call the completion closure, or completionBlock in Objective-C, after you finish processing the selection. If you need to perform asynchronous tasks, dispatch them to a background queue and call the completion closure or completionBlock when they complete. CarPlay displays an asynchronous progress indicator until you call the completion closure.
DemoCarPlaySearch-> this can actually go into the api-search repository. It is designed not to have external dependencies.