InstantSearch Android FAQ
On this page
- 1. Does Algolia support Dart and Flutter?
- 2. Does Algolia support React Native?
- 3. Why am I getting “JsonDecodingException” issues?
- 4. I am not seeing any results nor errors when trying out InstantSearch, what can I do?
- 5. Why aren’t Insights events appearing on my dashboard?
- 6. How can I see the logs for the network requests and the applied filters?
- 7. 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 am I getting “JsonDecodingException” issues?
Make sure you update to version ^2.4.0 as we have improved our serialization strategy and should have solved all issues.
It’s recommended to use the Kotlin API client, which is better suited for Android development.
I am not seeing any results nor errors when trying out InstantSearch, what can I do?
You need to subscribe to errors first. Try and subscribe to the searcher
’s errors to figure out what is going on. There could, for example, be serialization issues.
1
2
3
searcher.error.subscribePast {
Log.i("e", it.toString())
}
It’s recommended to use the Kotlin API client, which is better suited for Android development.
Why aren’t Insights events appearing on my dashboard?
There’s a slight delay because events are sent in batches. This batching reduces the number of requests and network traffic on mobile devices. 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 appear. 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.
How can I see the logs for the network requests and the applied filters?
To monitor the network requests, you can go to your Logcat and type HttpClient
.
To see the currently applied filters, you can subscribe to the filterState
like this:
1
2
3
4
filterState.filters.subscribe {
val filterString = FilterGroupsConverter.SQL(it.toFilterGroups())
Log.i("filterState", filterString ?: "" )
}
It’s recommended to use the Kotlin API client, which is better suited for Android development.
How can I set up a banner?
To display a banner, you need to listen to the searcher
’s result update, extract the userData
which contains the banner information, and then use that information to update your UI.
1
2
3
4
searcher.response.subscribePast { response ->
val msg = response?.userDataOrNull?.firstOrNull()?.getPrimitiveOrNull("promo_content")?.content
// display msg in a banner if it is available
}