question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

add geolocation to susi api call

See original GitHub issue

Currently the http://api.asksusi.com/susi/chat.json api is called without a location information.

Expected Behaviour

For location-based services, we need the local geolocation of the android device. If the user has no GPS switched on, you can also use the fuzzy location that can be obtained in android using a network provider. The details are explained in the first answer of http://stackoverflow.com/questions/6181704/good-way-of-getting-the-users-location-in-android … please use that method.

That longitude and latitude parameter must be appended to the susi api call. Currently a call is like:

http://api.asksusi.com/susi/chat.json?timezoneOffset=-60&q=where+am+I

This must become a call like:

http://api.asksusi.com/susi/chat.json?timezoneOffset=-60&longitude=8.11&latitude=55.8&q=where+am+I

Steps to reproduce it

Use the android device to ask where you are. An example output will be provided as the solution evolves.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
Orbitercommented, Dec 7, 2016

That’s fine, we will have another issue to handle the map in a consistent way with the question ‘where is’

1reaction
Orbitercommented, Dec 6, 2016

freegeoip should be considered as a nice-to-have add-on. It also rises the question if we need another attribute which declares the accuracy of the location which again rises the question on how to handle that.

Therefore let’s add another query attribute named geosource where you can set a text, one of

  • gps (for LocationManager.GPS_PROVIDER)
  • network (for LocationManager.NETWORK_PROVIDER)
  • ip (for geoip)

And please compute the geoip only if none of GPS_PROVIDER and NETWORK_PROVIDER is available. Please also do the call to freegeoip at most once.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Use API Keys with Geolocation API - Google Developers
Go to the Google Maps Platform > Credentials page. Go to the Credentials page · On the Credentials page, click Create credentials >...
Read more >
2.2 Geolocation Web API - Working with Data and ... - YouTube
https://github.com/CodingTrain/Intro-to-Data- APIs -JSBefore diving into communication between client and server (GET and POST requests), ...
Read more >
Using the Geolocation API - JavaScript Tutorial - YouTube
In today's video I'll be taking you through how to use the Geolocation API in JavaScript, which provides your users with a means...
Read more >
Testing Susi:Ai android app - Blog | Home
So today i got a chance to use and test Susi:Ai android app! ... problems most of the time , it seems like...
Read more >
fossasia/susi_iOS: SUSI AI iOS app http://susi.ai - GitHub
The SUSI iOS App make use of the APIs to access information from the hosted ... Geolocation information for example helps to offer...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found