InstantSearch iOS FAQ
On this page
- 1. Does Algolia support Dart and Flutter?
- 2. Does Algolia support React Native?
- 3. Why are Insights events not appearing on my dashboard?
- 4. Which package managers do you support?
- 5. How can I modify the query parameters?
- 6. Why aren’t my filters applied when modifying the filterState?
- 7. How can I apply filters only when the user clicks a button?
- 8. I’m seeing neither results nor errors when trying out InstantSearch. What can I do?
- 9. How can I set up a banner?
It’s recommended to use the Kotlin API client, which is better suited for Android development.
Does Algolia support Dart and Flutter?
We don’t have an official API client for Dart. However, there are many options that you can go with:
- Use platform channels to integrate Flutter with iOS and Flutter with Android, by using the official Swift and Kotlin clients.
- Use the Algolia REST API directly. Keep in mind that there’s no retry strategy at the API level, and no guaranteed SLA.
- Use an unofficial Dart API client. Keep in mind that we don’t provide any support for these, and there is no guaranteed SLA.
You can also check this tutorial to integrate Algolia with Flutter and Firestore.
It’s recommended to use the Kotlin API client, which is better suited for Android development.
Does Algolia support React Native?
Yes, we support React Native with our React InstantSearch library.
It’s recommended to use the Kotlin API client, which is better suited for Android development.
Why are Insights events not appearing on my dashboard?
There’s a slight delay because events are sent in batches. This batching reduces the number of requests and network consumption on mobile. You can change the batch size if you need to. Larger batch sizes mean that there will be some extra processing on the server, so it could take a few extra minutes for events to be displayed. If you wish, you can also enable logging for more visibility of when events are sent.
It’s recommended to use the Kotlin API client, which is better suited for Android development.
Which package managers do you support?
Algolia supports all popular package managers: Carthage, CocoaPods and Swift Package Manager.
It’s recommended to use the Kotlin API client, which is better suited for Android development.
How can I modify the query parameters?
Each searcher
gives you access to the query property via searcher.request.query
. For example, if you want to modify the hitsPerPage
parameter:
1
searcher.request.query.hitsPerPage = 30
It’s recommended to use the Kotlin API client, which is better suited for Android development.
Why aren’t my filters applied when modifying the filterState
?
When updating the filterState
manually, you need to call filterState.notifyChange()
for all components to update themselves with the new filterState
.
Algolia requires that you explicitly notify changes to avoid unnecessary requests when modifying several filters, and minimize the number of operations.
It’s recommended to use the Kotlin API client, which is better suited for Android development.
How can I apply filters only when the user clicks a button?
The filterState
was designed to constantly connect with all other components for results to appear in real time. However, if you don’t need real time updates, you can make a copy of the original filterState
, apply filters to it, and only copy back to the original filterState
(the one linked to other components like the searcher
) upon user action.
It’s recommended to use the Kotlin API client, which is better suited for Android development.
I’m seeing neither results nor errors when trying out InstantSearch. What can I do?
Subscribe to the searcher’s onError
event to figure out what is going on. There could be a serialization issue, among other issues.
1
2
3
4
searcher.onError.subscribePast(with: self) { (_, queryAndError) in
let error = queryAndError.1
print(error)
}
It’s recommended to use the Kotlin API client, which is better suited for Android development.
How can I set up a banner?
You need to listen to the searcher result update, extract the userData which contains the banner information, and then use that information to update your UI.
1
2
3
4
5
searcher.onResults.subscribe(with: self) { (_, results) in
let bannerDict = searchResults.userData?.first?.object() as? [String: String]
let msg = bannerDict?["promo_content"]
// display msg in a banner if it is available
}