Geolocation for filter design

Hello everybody,
is there a good way to get access to the geolocation of a user? i want to design a smartphone app, which will change some filters dependig on the geolocation of the users. I work in xcode and it would be easy with swift (as far as i know), but is there a good way in c++ / Juce?

thank you very much for your help!
Kajetan Enge

We don’t currently have any geolocation abstractions - it’s something you’d need to implement natively for each platform.

Thank you for your quick answer! do you by any chance know where i can learn to implement this natively?

I would look at the iOS Objective-C API and call that in an Objective-C++ class (.mm) file.
My advice when doing this is to keep your header file free of any Objective-C imports (do those in the .mm file).

Depending on the accuracy you need, you could also just geo locate the IP address of the user. You wouldn’t need to write any native code for this - just use JUCE’s IPAddress class to get the IP address and use the URL class to send a geolocation request to one of the many online RESTful IP geolocation services.

1 Like

This saved me! Thanks!