1

We have integrated Plot Projects for monitoring geo fences. When using Apples region monitoring we can simulate location when running the project from Xcode, tried to do the same but not getting notification from Plot, how can I simulate location and get notification for testing purpose?

Thanks In advance,

OSD
  • 131
  • 1
  • 10

2 Answers2

1

To simulate a location on a device attached to the Xcode debugger, you can use the Debug->Simulate Location menu item in Xcode.

enter image description here

You can either use one the pre-set locations or add your own GPX file. A GPX file can contain a series of locations and Xcode will simulate movement between those locations in a loop.

Don't forget to select "Don't simulate location" when you are done or the location will still be simulated until you reboot the device.

Paulw11
  • 108,386
  • 14
  • 159
  • 186
  • Thanks Paulw11 I have tried this already but plot is not giving me push notification for the fence. (As i said in my question i have integrated plot project for region monitoring) – OSD Jul 11 '16 at 07:29
  • I have used this with geofence and it works. It may be an issue with your app. – Paulw11 Jul 11 '16 at 07:44
  • Are you using plot project for geo fence? – OSD Jul 11 '16 at 08:11
  • No, I have my own code. You can see my test project here https://bitbucket.org/paulw11/locationtest I don't know what the "Plot project" is. – Paulw11 Jul 11 '16 at 08:12
  • OK. I Googled it. They say "Using our very own algorithm for location tracking,", so maybe they aren't using standard iOS regions. Still, if they are using data from the GPS in any way the Xcode simulation should deliver the simulated location data to their code. Even the iOS maps application will show your simulated location if you have it on – Paulw11 Jul 11 '16 at 08:17
  • 1
    Their documentation says "The plugin makes use of the region monitoring capabilities provided by iOS and some improvements we have added ourselves. The location of the user will be determined in a way that minimizes battery usage; GPS is almost never used as the service uses Wifi-triangulation. " so you may not be able to simulate location – Paulw11 Jul 11 '16 at 08:20
  • Ok, thats a tough situation for testing I guess. Thanks Again Paul for your support :) – OSD Jul 11 '16 at 08:29
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/116967/discussion-between-osd-and-paulw11). – OSD Jul 11 '16 at 08:50
  • Plot Projects developer here: Using a simulated location should work without problems. I don't know what is causing the issue in your case. For best results ensure the location is set before the app is opened. You can verify if the location is set properly by using the built-in Maps application. Our experience though with a simulator is that background execution works a bit different, so I do recommend testing on an actual device. – Mark Jul 11 '16 at 08:52
  • Hi Mark, thanks for the reply. I am testing on actual device not simulator. My testing procedure was - installed app from Xcode and simulated a gpx location, I got a response in debugger - Plot| Acquired location: 25.069283,55.141722 (accuracy 5.000000 meter), but dint get the push notification. – OSD Jul 11 '16 at 09:23
  • The log output should also should which notifications got loaded. When multiple very large location changes follow after each other it is possible that the locations for the current location don't get loaded. You can see this in the debug output. – Mark Jul 11 '16 at 09:34
  • I dint understand that, can you please explain bit more. ". When multiple very large location changes follow after each other it is possible that the locations for the current location don't get loaded" did you mean notification for the current location don't get loaded? – OSD Jul 11 '16 at 09:43
0

If someone is looking for the answer, put your phone in airplane mode and simulate location and switch off airplane. You will get push notification. If you don't get, restart the phone and try simulate location with airplane off.

OSD
  • 131
  • 1
  • 10