Starting May 1, 2024,
Apple requires all iOS apps to include a privacy manifest.
For more information, see Privacy manifest.
Upgrade to InstantSearch iOS v8
InstantSearch iOS v8 migrates the underlying Algolia client from v8 to the Algolia Swift API Client v9. This introduces several breaking changes.Update dependencies
- Swift Package Manager
- CocoaPods
Update your
Package.swift dependency:Swift
Handle throwing initializers
Searcher convenience initializers that acceptappID and apiKey strings now throw errors because SearchClient(appID:apiKey:) throws in the Algolia Swift API Client v9. This applies to HitsSearcher, FacetSearcher, MultiIndexSearcher, and MultiSearcher.
SearchClient yourself and use the non-throwing initializer:
Swift
Remove answers and places usage
InstantSearch iOS removedAnswersSearcher and PlacesSearcher (including their services and connectors) because Algolia Answers and Algolia Places are no longer available.
Remove code that references these types.
AnswersSearcher,AlgoliaAnswersSearchService,AnswersSearcher+FilterStatePlacesSearcher,AlgoliaPlacesSearchService,Hit+Place,HitsConnector+GeoSearchIndexSegmentInteractor+AnswersSearcher
Adapt to new query types
The query parameter type has changed from the v8 client’sQuery to SearchSearchParamsObject from the v9 client.
If you set query parameters directly,
update your code to use SearchSearchParamsObject.
Use the local Hit type
The Hit type is now defined locally in InstantSearchCore rather than being re-exported from the API client.
If you reference Hit from the Algolia client module, update your imports.
A SearchHit type alias for Hit<[String: AnyCodable]> is available for convenience.
Update event tracking
Starting from v7.26.2, InstantSearch makes it easier to send view events using theisAutoSendingHitsViewEvents option on HitsSearcher:
Swift
Upgrade to InstantSearch iOS v5
InstantSearch v5 introduces a new architecture and new widgets, which brings several breaking changes from the previous versions:-
No
InstantSearchcomponent to automatically connecting widgets. You are now in control of theSearcherand responsible for connecting and disconnecting it from widgets and other components. -
Widgets are now built around an
Interactor, which holds their data and business logic. In previous versions, widgets were iOSUIViews. Now the core of a widget is its interactor. The widget’s UI is behind an interface to minimize coupling.
The InstantSearch iOS v3 documentation is available on the legacy docs page.