Code Monkey home page Code Monkey logo

Your app uses https://api.mapbox.com/geocoding/v5 to get recommendations after using AddressAutofill, somehow after integrating your modules in my project it uses https://api.mapbox.com/autofill because of that I can't get recommendations to search about mapbox-search-android HOT 7 CLOSED

mapbox avatar mapbox commented on August 17, 2024
Your app uses https://api.mapbox.com/geocoding/v5 to get recommendations after using AddressAutofill, somehow after integrating your modules in my project it uses https://api.mapbox.com/autofill because of that I can't get recommendations to search

from mapbox-search-android.

Comments (7)

DzmitryFomchyn avatar DzmitryFomchyn commented on August 17, 2024 1

@AndrewKisyk ,

in "sample" app from this repo, after calling addressAutofill.suggestions(query = query, options = AddressAutofillOptions()) this( "[ https://api.mapbox.com/geocoding]" search endpoint called

It shouldn't work this way, AddressAutofill works over https://api.mapbox.com/autofill endpoint. You can check it in the following code example

class AddressAutofillKotlinExampleActivity : AppCompatActivity() {

    private lateinit var addressAutofill: AddressAutofill

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        HttpServiceFactory.getInstance().setInterceptor(object : HttpServiceInterceptorInterface {
            override fun onRequest(request: HttpRequest): HttpRequest {
                Log.i("SearchApiExample", "onRequest: $request")
                return request
            }

            override fun onDownload(download: DownloadOptions): DownloadOptions {
                Log.i("SearchApiExample", "onDownload: $download")
                return download
            }

            override fun onResponse(response: HttpResponse): HttpResponse {
                Log.i("SearchApiExample", "onResponse: $response")
                return response
            }
        })

        addressAutofill = AddressAutofill.create(
            accessToken = getString(R.string.mapbox_access_token),
        )

        lifecycleScope.launchWhenCreated {
            val query = Query.create("740 15th St NW, Washington") ?: return@launchWhenCreated

            addressAutofill.suggestions(
                query = query,
                options = AddressAutofillOptions()
            ).onValue { suggestions ->
                Log.i("SearchApiExample", "Autofill suggestions: $suggestions")
            }.onError { error ->
                Log.i("SearchApiExample", "Autofill suggestions error", error)
            }
        }
    }
}

If you see that it works over https://api.mapbox.com/geocoding, it's a bug and I'll appreciate more details about your environment and isolated code example that could demonstrate this behavior.

If you need https://api.mapbox.com/geocoding, you should use SearchEngine with ApiType.GEOCODING

from mapbox-search-android.

DzmitryFomchyn avatar DzmitryFomchyn commented on August 17, 2024

@AndrewKisyk could you please give more details and code examples?

from mapbox-search-android.

AndrewKisyk avatar AndrewKisyk commented on August 17, 2024

@DzmitryFomchyn in "sample" app from this repo, after calling addressAutofill.suggestions(query = query, options = AddressAutofillOptions()) this( "[ https://api.mapbox.com/geocoding]" search endpoint called. When I use this method from my app this( "[ https://api.mapbox.com/autofill]" search endpoint called. How should I configure AddressAutofill to use the same endpoint as yours?

from mapbox-search-android.

DzmitryFomchyn avatar DzmitryFomchyn commented on August 17, 2024

@AndrewKisyk,
Any update here? Did you have a chance to check sample?

from mapbox-search-android.

AndrewKisykP avatar AndrewKisykP commented on August 17, 2024

@DzmitryFomchyn Yes I have. The solution is to use SearchEngine, thanks. Is it possible for me to join Beta Porgram?
Because most of the search features are not available for me?

from mapbox-search-android.

DzmitryFomchyn avatar DzmitryFomchyn commented on August 17, 2024

@AndrewKisyk please, contact sales team for this question https://www.mapbox.com/contact/sales/.
If everything is working on the SDK side, can we close this issue?

from mapbox-search-android.

AndrewKisykP avatar AndrewKisykP commented on August 17, 2024

yes, sure

from mapbox-search-android.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.