Skip to end of metadata
Go to start of metadata

If you're not ready to turn on persistent location updates within your app, but still want to trigger a message based on a user-initiated location update, you can follow these steps to include a "Check-in Button" within your iOS app.  Performing these steps will turn off automatic location updates between the device and Xtify, the user will not receive a popup asking them if they want your app to track locations, yet you'll still be able to receive a location update ONLY IF the user presses a button. We still recommend fully disclosing this method within a section of your app, perhaps your "About" page. 

These instructions are based on our sample app "SampleRichWithTabs" included within the latest version of our iOS SDK, integrating this in your existing Xtify-powered app should be pretty easy as well.

Getting Started

  1. Download our latest SDK for iOS. This includes the Xtify library and two sample apps.
     
  2. Follow our instructions to setup xCode, create your push certificates at Apple and configure your app with Xtify.  You should start out by building the sample app "SampleRichWithTabs" with location updates on so you understand the  default behavior. In XtifyGlobal.h set: 

  3. Confirm that you can receive messages within your sample app by either using our API or our Console. It might be a good idea to also be come familiar with how to setup a rich notification campaign with a location rule. You can do this via our API or the Console. Here's a how-to guide that walks through this process on our Console.

Creating the Check-in Button Action

In our example, we're going to add a check-in button to the first view that loads after the user launches the app.

  1. Open AboutPage.m and add the button control to the view. 

Create the Check-in Button Action

  1. Open AboutPage.h and declare your button selector:

  2. Open AboutPage.m, import XLLocationMgr:


    and add your button action method. This method will receive the request when a user presses the check-in button, and will then fire a one-off location update which will then be sent to Xtify.

  3. Open XtifyGlobal.h, turn off persistent location updates and the prompt asking for permission to do so:

  4. Build the sample app, setup a location triggered message and test!

Please remember, if you choose to employ this method, triggering updates via persistent location updates will not work. Currently, you have a choice between one method or the other.

Labels: