New Consumer Study - Gas and Convenience Read Now

Our site uses cookies. By continuing to use our site, you are agreeing to our Cookie Policy
OK, I understand

Testing the Bluedot Point SDK with Xcode iOS Simulator - Featured Image
By Judy Chan | July 12

Testing the Bluedot Point SDK with Xcode iOS Simulator

 jason-headshot_1

by JASON XIE
Senior iOS Developer,  Bluedot Innovation

The Bluedot Point SDK lets you trigger a wide range of location-based actions whenever a user of your mobile app enters a location, such as the entrance of a sports venue, but testing the app can be challenging if you have multiple venues. This is where the 'Simulator' version of the Point SDK becomes really handy for your early testing of Zone configurations along with user experience and functional testing. 
 
Let’s say you want your app to deliver a QR code to automate entry to the venue to users who enter through the North gates and send a discounted membership offer to the users who venture via the South entrances. You only want the location-based code and promo to be sent right before the game, between 4:00pm and 6:00pm on Saturdays. Testing in-person would be difficult since you would have to run the tests to cover the many types of devices that your app may be running on.
 
Here’s an easier way: the 'Simulator' version of the Point SDK lets you run these tests from your desk. The Xcode's location simulation feature allows you to simulate a pre-defined route using a number of waypoints in a .gpx file or just inject a custom coordinate. The iOS Simulator version of the Bluedot Point SDK named "libBDPointSDK-iphonesimulator.a"  is already packaged within the library archive that can be downloaded from the Bluedot Point Access Dashboard. We will demonstrate how the Xcode iOS Simulator and Point SDK can work in tandem to lend you a hand with the testing.  Our aim is to simulate a device's presence in a geofence and will utilize the simple custom location feature of the Simulator. 
 
The tools and set-up:

Location trigger simulation:

To get started, make sure to have the Bluedot Point SDK integrated with either our demo app project or follow the documentation to integrate the SDK with your own app. The overall integration and testing should only take about 30 minutes. (For some reason, if it takes longer, comment below to let us know. We’re always looking to simplify the process.)

1. Login to the Bluedot Dashboard to create Zones, Actions, and Conditions for the location-based user experiences for your app. The Point SDK's advanced location engine can process multiple actions under a Zone and it can also evaluate and handle multiple conditions that are listed under an Action. To keep this demo simple, we will drop a Polygonal Geofence covering the North entrance of the Ohio Stadium and set up a message action to fire when the device enters the Geofence. In the message, include instructions prompting the user to tap to view and scan the QR code. This will allow the user to tap on the push notification to be taken directly to the QR code page.

ohio-stadium-northern-entrance_orig

2. Launch your app in the simulator and authenticate with the Point SDK. Push the app to the background to test the Geofence-triggering feature in the background.  Jump back to Bluedot’s Map Interface and right-click anywhere within the Geofence and select Get coordinates from the drop-down menu. When you see the info window containing the latitude and longitude for the selected location, copy the values straight into the custom location of the simulator. Finally, click OK to see the push notification appear.  

bdhowtosimulatelocation2

3. Success! You’ve triggered the message at the entrance. All that’s left is to tap the notification to open the QR code and you’re ready to enter the venue. 

xcode-ios-simulator

The complete source code for the app used in this post can be downloaded on Bluedot Innovation's GitHub page

There is no substitute for real testing with real devices

Make sure you send someone with a few real devices to visit locations to bulletproof the testing.
 
Product updates to come:

In our research lab, Bluedot DevOps engineers use a variety of our own advanced simulators for all kinds of testing. We are working on making parts of the simulator available in the product by orchestrating our powerful location engine with the map interface of the backend to make testing complex location-based scenarios and conditions even easier right from your desk. Keep an eye on our product release notes for further updates.