Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose the GeoIP API for the mobile app #10594

Closed
g123k opened this issue Jul 25, 2024 · 2 comments · Fixed by #10648
Closed

Expose the GeoIP API for the mobile app #10594

g123k opened this issue Jul 25, 2024 · 2 comments · Fixed by #10648

Comments

@g123k
Copy link
Collaborator

g123k commented Jul 25, 2024

Hi everyone,

In the OFF mobile application, we’d like to identify the user’s country based on the IP (it’s not perfect, but it’s good enough).
I know a GeoIP implementation is used on the server.

Would it be possible to expose it as an API?

@stephanegigandet
Copy link
Contributor

@4nt0ineB maybe add a few tests for the new API, to make sure we don't break it in the future

@g123k
Copy link
Collaborator Author

g123k commented Aug 13, 2024

Thanks for the PR.

However, getting the public IP from Dart is impossible without an external service (ex : IPify).
Would it be possible to change the endpoint from:
https://world.openfoodfacts.net/api/v3/geoip/85.214.132.117
to
https://world.openfoodfacts.net/api/v3/geoip/

Basically, if the IP is missing, use the one from the request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging a pull request may close this issue.

3 participants