anyone doing geofences?

Has anyone done any experimenting getting the geofencing interface to work on xojo? I’ve played with the xcode version, but have no idea where to start to get all those things into xojo.

I’m interested in this, too. I guess it has to do with the Google API in Xojo’s WebMapViewer class. Will do some research.

Not quite geofencing, but…

I just wrote an iOS app based off of the location example project. I have gps coordinates of a number of “checkpoints” entered in. I used code from the forum that calculates distance between 2 gps coordinates, to tell when I get within a given distance of any of the checkpoints. It keeps track of how long it takes me to get to each of the checkpoints along my driving route.

correct me if I’m wrong please, but any solution that isn’t apple’s geofences won’t work unless the app is running. The whole point of a geofence is that you register your locations with the OS and it wakes you up and alerts you to the event when you cross over any of the boundaries. Then you have a short time to do something about it or alert someone to it before you get put back to sleep. If your app is running then you can access the location data in real time, but if you want something to let you know when you get home a week from now when you’re running podcasts instead of your app then geofences are the only option.

To implement Geofences there are several pre-requisites, note that this code uses deprecated features from iOS 10 that might not work in the future.

First add iOSKit to your app:
https://github.com/kingj5/iOSKit

Then implement improvediOSApplication:

[quote=163679:@Jason King]I was going to add some of the delegate methods that deal with notifications but that is going to take additional work in creating a few separate classes so I’m actually going to leave it for a later time.
Here is the project:
https://www.dropbox.com/s/ornbgst9rmme6t7/improved%20iosapplication.xojo_binary_project?dl=0
To use simply add the class to your project and change the super of the App object in your project from iOSApplication to ImprovedIOSApplication. Then implement the events you want and that’s it.
Enjoy![/quote]

You will then need to add some code to UILocalNotification in order to use region as CLRegion https://developer.apple.com/documentation/uikit/uilocalnotification/1616644-region

Finally, your app must ask the user authorization to display notifications and use location features.