Simulate a Location in the iOS Simulator Follow
This article discusses the iOS Simulator, but this technique also works in the Android Emulator.
When you’re developing your app with the Meridian iOS SDK and previewing the app in the iOS Simulator, you can simulate a “current location” in the app.
The iOS Simulator doesn’t provide access to the Bluetooth hardware on your computer, which means it can’t determine location using Beacons or Wi-Fi.
Fortunately, you can simulate a location. Here’s how to do that:
Go to the desired floor in the Meridian Map Editor.
Add a Simulated Location
Click the location on the map you want to simulate, and then press the lowercase L key. A dialog will appear with the message, “Simulated Location Set”. After a short time, the simulated location you set in the Editor will appear as a pink dot in the iOS Simulator.
Remove a Simulated Location
Click anywhere on the map, and press Shift+L. A dialog will appear with the message, “Simulated Location Removed”.
Simulate a Location on an iOS Device
In addition to simulating a blue dot in the iOS Simulator, you can also do this on your iOS device using the following Meridian SDK code after adding the simulated pink dot in the Editor.
let config = MRConfig() config.applicationToken = "090c29d8b4cc628e4bd327abf37f62e4e3477bae" config.useSimulatedLocation = true Meridian.configure(config)
The application token above is for the iOS SDK Sample app. If you’d like to simulate a blue dot for your location, generate a token for your location in the Meridian Editor.
Comments
0 comments
Please sign in to leave a comment.