I am migrating to the new places SDK 4.0
The old func was:
findAutocompletePredictions(fromQuery: query,
bounds: bounds,
boundsMode: .bias,
filter: filter,
sessionToken: token) { (prediction, error) in
callback(prediction, error)
}
the new func as per docs is
findAutocompletePredictions(fromQuery: query,
filter: filter,
sessionToken: token) { (prediction, error) in
callback(prediction, error)
}
I see that bounds bias is now set on the GMSAutocompleteFilter filter
This has a locationBias property where i set some and it takes a parameter of <GMSPlaceLocationBias>
The issue i have is there is no info on what to provide here...GMSPlaceLocationBias is a protocol, and i have no idea what im meant to use object wise to provide the old bounds data.
Conforming to the protocol gives me a locationBiasURLQueryItem fun to populate, with no further documentation on what should go in this function
So im stuck and cant upgrade as there doesnt seem to be a clear way forward.
Anyone have any ideas? Docs are here: https://developers.google.com/places/ios-sdk/reference/interface_g_m_s_places_client#ab60773feec0e68751c5a7f1066b9d252)
My attempt to construct the filter is:
let filter = GMSAutocompleteFilter()
if case .location(let location) = _locationController.locationStatus {
filter.locationBias = .some(location)
}
But obviously my custom location model object doesnt confirm to GMSPlaceLocationBias and is a struct so cant be used and errors