Backendless Support
 
Waiting for user's response

saving geopoint, geofence swift 4 example

Could you please post a simple example of saving a geopoint and

executing geofence in-app callbacks in Swift 4? All the examples in the

doc. seem to be in an older version of swift and I can't get them to

work. I reviewed the sdk installation and the project setup instructions and I'm pretty sure I did that right, but I still can't get it to work. Thanks.

Leave a Comment

Comments (4)

photo
1

Hello,

can you attach your zipped project to this topic or send it to us. We will review it and try to figure out what is the problem

photo
1

Here it is. Thank you Sergey.

photo
photo
1

I have created an internal ticket for this task BKNDLSS-16865

photo
1

Hello,

Please check this doc for saving geopoint, this doc for geofence configuration and this doc for geofence api - the examples work fine.

Also please check if your geo fence is active (at least one action should be configured).

E.g.

I have the "myFence" geoFence with "on enter action" (scr1.png, scr2.png)

When I save my point, I receive the pubsub callback from server (scr3.png):

  1. func saveGeoPoint() {
  2. me = GeoPoint.geoPoint(GEO_POINT(latitude: 37.77, longitude: -122.41)) as? GeoPoint
  3. backendless.geo.save(me, response: {
  4. savedGeoPoint in
  5. print("Geo point saved")
  6. }, error: { fault in
  7. print("Server reported an error: \(fault?.message ?? "")")
  8. })
  9. }

Regards, Olga