Swrve Geo
Send targeted, geo-triggered notifications to your app users with Swrve Geo. To use this feature, you must integrate the Geo project alongside the general Swrve SDK for your platform. This guide explains how to integrate Swrve Geo for iOS, Android, and React Native.
Requirementsβ
- Request a copy of the Swrve Geo project for your app platform from your CSM at support@messagegears.com. They will enable Geoplaces in your Swrve dashboard.
- The current version of Swrve Geo has the following native SDK / Plugin minimum version dependency:
- iOS SDK 7.0.3
- Android SDK 11.0.0
- React Native SDK plugin 1.0.0
- Swrve Geo for Android uses Android's native geofencing APIs, so the following services and permissions are required:
- Google Play Services
- Wi-fi scanning set to "on"
- Location setting set to "on"
- On Android API level 26 and above, a foreground notification is recommended for reliable geoplace triggering. While the Swrve SDK can function without it, omitting the foreground notification will reduce the accuracy and timeliness of geoplace triggers. You can optionally configure this notification within SwrveGeoConfig.
- For Android API level 28 and lower, use the
ACCESS_FINE_LOCATIONpermission. - For Android API level 29, the
ACCESS_BACKGROUND_LOCATIONpermission must be set to "Allow all the time". The βAllow only while using the appβ permission is not supported.
- Swrve Geo for iOS requires iOS 15.0 or later. It uses iOSβs native region monitoring and, unless you turn on reduced location usage, the Significant-Change Location service. The following services and permissions are required:
- Location Services set to "On"
- Location permission set to "Always". With "While Using", iOS holds geofence events until the user next opens your app, and SwrveGeoSDK discards them as out of date.
- Precise Location set to "On". With approximate location, region monitoring doesn't work, so enter and exit transitions don't trigger.
- On every platform, the user must allow notifications for your app, because geo-triggered campaigns are notifications. Ask for notification permission before you start SwrveGeoSDK.
- Once integrated, SwrveGeoSDK silently does nothing on devices that donβt have the appropriate device capabilities. Both iOS and Android platforms can restrict installations of an app to devices that only support these capabilities. If youβd like to restrict your app to be only installed on those devices, speak to your CSM.
Integration instructionsβ
Select one of the platform tabs below for integration instructions.
- Android
- iOS - Swift
- iOS - Objective-C
- React Native
There are two main folders in the Geo project for Android:
- SwrveGeoSDK is an Android library project that you integrate as a separate Gradle dependency alongside the standard Swrve Android SDK.
- SwrveGeoSample provides a basic example of how to integrate Swrve Geo for Android.
Integration stepsβ
Step 1: Add the following dependencies to your app build.gradle file:
api 'com.swrve.sdk.android:swrve-geo:7.3.0'
Step 2: Choose when and where to ask for location permission. You also have the option to include a pre-prompt and post-prompt dialog.
- Call the SwrveGeoSDK Start API at the moment you want to display the location permission prompt. Further calls to this API will have no effect unless you call the SwrveGeoSDK Stop API.
SwrveGeoSDK.start(this);
Note: If your native SDK configuration uses MANAGED mode for creating the SwrveSDK instance, then start the SwrveGeoSDK only after you've called the SwrveSDK Start API.
- Android best practices recommend explaining to your users why your app requires location permission before requesting it. For example,

To display your explanation and prompt buttons before you initiate the system permission request, use the permissionPrePrompt API in the SwrveGeoConfig. If you prefer to use your own UI or don't want to include a pre-prompt, skip this option.
SwrveGeoConfig geoConfig = new SwrveGeoConfig.Builder()
.permissionPrePrompt(getString(R.string.pre_prompt_rationale),
getString(R.string.pre_prompt_proceed_button_text),
getString(R.string.pre_prompt_cancel_button_text))
.build();
SwrveGeoSDK.init(this, geoConfig);
- If a customer declines the system permission prompt, use the
permissionDeniedPostPromptAPI to confirm their selection and explain the features they miss out on by not giving permission. For example,

This option also gives you the opportunity to include a button that takes the user to the system settings if they want to manually grant permission. If you don't want to display the additional prompt, skip this option.
SwrveGeoConfig geoConfig = new SwrveGeoConfig.Builder()
.permissionDeniedPostPrompt(getString(R.string.post_prompt_text),
getString(R.string.post_prompt_settings_button_text),
getString(R.string.post_prompt_cancel_button_text))
.build();
SwrveGeoSDK.init(this, geoConfig);
Step 3: In the Application class where the SwrveSDK instance is created, initialize SwrveGeoSDK directly after you initialize SwrveSDK.
For better performance on devices running Android Oreo and above, we also recommend setting the foreground service notification and notification ID in the SwrveGeoConfig. The notification ID is a unique integer you must set that identifies each notification. Providing value in the content of the foreground service notification makes it easier for users to buy in to allowing this. To keep the content relevant, use the same notification ID to update the notification content on a regular basis.
Replace <app_id> and <api_key> with your app ID and API key.
SwrveSDK.createInstance(application, <app_id>, <api_key>);
Notification fgNotification = getGeoForegroundNotification(); // implement your own foreground notification
SwrveGeoConfig geoConfig = new SwrveGeoConfig.Builder()
.foregroundNotification(fgNotification, YOUR_FOREGROUND_NOTIFICATION_ID)
.permissionPrePrompt(getString(R.string.pre_prompt_rationale),
getString(R.string.pre_prompt_proceed_button_text),
getString(R.string.pre_prompt_cancel_button_text))
.permissionDeniedPostPrompt(getString(R.string.post_prompt_text),
getString(R.string.post_prompt_settings_button_text),
getString(R.string.post_prompt_cancel_button_text))
.build();
SwrveGeoSDK.init(this, geoConfig);
Step 4: If your app configures the foreground notification in SwrveGeoConfig, you must also declare the use of the FOREGROUND_SERVICE_LOCATION permission and provide a justification for its use in the Google Play Console. This is required by Google Play's policy for apps using foreground services related to location. Add the following permission and service in your AndroidManifest.xml.
<uses-permission android:name="android.permission.FOREGROUND_SERVICE_LOCATION" />
<application>
....
<service
android:name="com.swrve.sdk.geo.SwrveGeoForegroundLocationUpdatesService"
android:enabled="true"
android:exported="false"
android:foregroundServiceType="location" />
.....
</application>
Step 5: Optionally, to update the foreground notification with more relevant content, use the same notification ID you set above to update the existing notification content.
NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this, "123");
mBuilder.setSmallIcon(R.drawable.logo)
.setContentText("Updated message that provides value")
.setContentTitle("Title");
Notification notification = mBuilder.build();
NotificationManager notificationManager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.notify(YOUR_FOREGROUND_NOTIFICATION_ID, notification);
There are two main folders in the Geo project for iOS:
- SwrveGeoSDK.xcframework is a library that you integrate alongside the standard Swrve iOS SDK.
- SwrveGeoSample provides a basic example of how to integrate Swrve Geo for iOS.
Integration stepsβ
Step 1: Add the following dependencies to your Podfile:
use_frameworks!
pod 'SwrveSDK'
pod 'SwrveGeoSDK'
SwrveGeoSDK requires that you have use_frameworks! in your CocoaPods.
Step 2: In your AppDelegate, implement the following:
- Import the SwrveGeoSDK framework.
import SwrveSDK
import SwrveGeoSDK
- Initialize SwrveGeoSDK directly after initializing SwrveSDK. Replace
<app_id>and<api_key>with your app ID and API key.
SwrveSDK.sharedInstance(withAppID: <app_id>, apiKey: "<api_key>")
let geoConfig = SwrveGeoConfig()
SwrveGeoSDK.initWith(geoConfig)
- To ask for location permission, call the SwrveGeoSDK Start API when location helps the user. SwrveGeoSDK restarts by itself on later launches, and further calls have no effect until you call the Stop API. For what it asks for, see Location permission on iOS.
SwrveGeoSDK.start()
To stop SwrveGeoSDK, for example when a user turns off location offers in your app, call SwrveGeoSDK.stop().
Note: If your native SDK configuration uses MANAGED mode for creating the SwrveSDK instance, then start the SwrveGeoSDK only after you've called the SwrveSDK Start API.
Step 3: In your Info.plist, add the following keys. iOS shows these strings in the location prompts, so use them to explain what the user gets in return. For example, "Goaletics uses your location to inform you about deals and events in your area."
NSLocationWhenInUseUsageDescription- Shown in the first prompt, which offers While Using.NSLocationAlwaysAndWhenInUseUsageDescription- Shown in the prompt to upgrade to Always.
There are two main folders in the Geo project for iOS:
- SwrveGeoSDK.xcframework is a library that you integrate alongside the standard Swrve iOS SDK.
- SwrveGeoSample provides a basic example of how to integrate Swrve Geo for iOS.
Integration stepsβ
Step 1: Add the following dependencies to your Podfile:
use_frameworks!
pod 'SwrveSDK'
pod 'SwrveGeoSDK'
SwrveGeoSDK requires that you have use_frameworks! in your CocoaPods.
Step 2: In your AppDelegate, implement the following:
- Import the SwrveGeoSDK framework.
#import <SwrveGeoSDK/SwrveGeoSDK.h>
- Initialize SwrveGeoSDK directly after initializing SwrveSDK. Replace
<app_id>and<api_key>with your app ID and API key.
[SwrveSDK sharedInstanceWithAppID:<app_id> apiKey:@"<api_key>"];
SwrveGeoConfig *geoConfig = [[SwrveGeoConfig alloc] init];
[SwrveGeoSDK initWithConfig:geoConfig];
- To ask for location permission, call the SwrveGeoSDK Start API when location helps the user. SwrveGeoSDK restarts by itself on later launches, and further calls have no effect until you call the Stop API. For what it asks for, see Location permission on iOS.
[SwrveGeoSDK start];
To stop SwrveGeoSDK, for example when a user turns off location offers in your app, call [SwrveGeoSDK stop].
Note: If your native SDK configuration uses MANAGED mode for creating the SwrveSDK instance, then start the SwrveGeoSDK only after you've called the SwrveSDK Start API.
Step 3: In your Info.plist, add the following keys. iOS shows these strings in the location prompts, so use them to explain what the user gets in return. For example, "Goaletics uses your location to inform you about deals and events in your area."
NSLocationWhenInUseUsageDescription- Shown in the first prompt, which offers While Using.NSLocationAlwaysAndWhenInUseUsageDescription- Shown in the prompt to upgrade to Always.
There are three parts to integrating React Native GeoβAndroid, iOS and then the React layer.
Integration stepsβ
Step 1: Install the standard Swrve React Native plugin. For more information, see the React Native integration guide.
Step 2: Add the react-native-swrve-geo-plugin to your project via npm:
npm install react-native-swrve-geo-plugin --save
If you prefer to use Yarn, run the following command:
yarn add react-native-swrve-geo-plugin
iOSβ
Navigate to the iOS folder of your React Native project.
Step 1: The SwrveGeoPlugin requires that you have use_frameworks! in your CocoaPods. Add the following to your Podfile:
use_frameworks!
Step 2: In the appDelegate.m file didFinishLaunchingWithOptions function, after you initialize the native SwrvePlugin, initialize the SwrveGeoPlugin:
#import "SwrvePlugin.h"
#import <SwrveSDK/SwrveSDK.h>
#import "SwrveGeoPlugin.h"
#import <SwrveGeoSDK/SwrveGeoConfig.h>
SwrveConfig* config = [[SwrveConfig alloc] init];
[SwrvePlugin initWithAppID:<app_id> apiKey:@"<api_key>" config:config];
SwrveGeoConfig *geoConfig = [[SwrveGeoConfig alloc] init];
[SwrveGeoPlugin initWithConfig:geoConfig];
Step 3: In your Info.plist, make sure you include values for the following keys to explain to your user why your app requires the related location permission. For example, "Goaletics uses your location to inform you about deals and events in your area."
NSLocationWhenInUseUsageDescription- explains why the app requires the user's location information when running in the foreground.NSLocationAlwaysAndWhenInUseUsageDescription- explains why the app requires access to the user's location at all times.
Androidβ
Navigate to the Android folder of your project.
Step 1: Similar to the steps required to integrate the React Native plugin for Android, in the android/app directory, add swrve-geo as a dependency to the build.gradle file:
dependencies {
implementation 'com.swrve.sdk.android:swrve-geo:5.0.0'
}
Step 2: In the MainApplication.java file, in the onCreate method, after you initialize the SwrvePlugin, initialize the SwrveGeoPlugin:
import com.swrve.reactnative.SwrvePlugin;
import com.swrvegeo.reactnative.SwrveGeoPlugin;
import com.swrve.sdk.config.SwrveConfig;
import com.swrve.sdk.geo.SwrveGeoConfig;
SwrvePlugin.createInstance(this, <app_id>, "<api_key>", swrveConfig);
SwrveGeoConfig geoConfig = new SwrveGeoConfig.Builder()
.permissionPrePrompt("", "Proceed", "No Thanks")
.build();
// Start Geo Plugin
SwrveGeoPlugin.init(this, geoConfig);
React layerβ
Once you've initialized the SwrveGeoPlugin in iOS and Android as above, import and start the plugin from the React layer:
import SwrveGeoSDK from 'react-native-swrve-geo-plugin';
SwrveGeoSDK.start();
Note: If your native SDK configuration uses MANAGED mode for creating the SwrveSDK instance, then start the SwrveGeoSDK only after you've called the SwrveSDK Start API.
Note: On every platform, SwrveGeoSDK saves whether it's started for each user. If your app identifies users, start SwrveGeoSDK once identify succeeds, for example in its success callback, and again each time you identify a different user.
Location permission on iOSβ
Swrve Geo triggers in the background only when the user allows location Always. iOS doesn't offer Always in the first location prompt, so getting Always takes two prompts:
- The first prompt offers Allow Once, Allow While Using App, and Don't Allow.
- Once the user allows While Using, the app asks for Always, and iOS shows the upgrade prompt, which offers Change to Always Allow and Keep Only While Using.
iOS shows the upgrade prompt only once. After the user declines it, only the Settings app can turn on Always.
Choose how SwrveGeoSDK asksβ
To choose what the SwrveGeoSDK Start API asks for, set permissionRequestMode in SwrveGeoConfig:
whenInUseThenAlways- The default. SwrveGeoSDK asks for While Using, then for Always as soon as it's allowed, so iOS shows the upgrade prompt while the user is still in your app.always- SwrveGeoSDK asks for Always in one request, as in versions before 5.2.0. If the user allows While Using, iOS shows the upgrade prompt later, the first time your app uses location in the background, over whatever the user is doing at the time.never- SwrveGeoSDK never asks, so your app chooses the moment and explains why. Ask for While Using, then Always. You still call the Start API, before or after asking, and SwrveGeoSDK sets up geofences as soon as either is allowed.
- iOS - Swift
- iOS - Objective-C
let geoConfig = SwrveGeoConfig()
geoConfig.permissionRequestMode = .never
SwrveGeoSDK.initWith(geoConfig)
SwrveGeoConfig *geoConfig = [[SwrveGeoConfig alloc] init];
geoConfig.permissionRequestMode = SwrveGeoPermissionRequestModeNever;
[SwrveGeoSDK initWithConfig:geoConfig];
If the user selects Don't Allow and later allows location in the Settings app, SwrveGeoSDK picks it up without another call to the Start API.
Ask with an in-app messageβ
Ask at a moment when location helps the user, such as after they place a pickup order, rather than when your app first opens. To ask with the default permissionRequestMode:
- Show an in-app message that explains what the user gets, and that iOS asks twice.
- On its button, use the Start Geo SDK action. SwrveGeoSDK starts and asks for permission.
- For users who didn't allow Always, show a second in-app message that uses the Open app settings action, so they can turn on Always in the Settings app. To target these users, use the
Swrve.permission.ios.location.alwaysdevice property, which SwrveGeoSDK sets toauthorizedonly for Always.
The Start Geo SDK action needs no extra code in your app. The SDK shows the message only while SwrveGeoSDK isn't started. With permissionRequestMode set to never, use the Request Permission action for location instead, which needs your app to implement SwrveInAppCapabilitiesDelegate. It only asks for permission, so your app still starts SwrveGeoSDK. For more information, see iOS.
Keep the message consistent with the location descriptions in your Info.plist, because iOS shows those in the prompts straight after. For more information, see Editing in-app message content.
Reduce location use on iOSβ
By default, while it's started, SwrveGeoSDK monitors significant location changes, so iOS wakes your app with a location about every 500 meters the user travels. SwrveGeoSDK also gets a location each time a session starts, so iOS shows the location indicator when your app opens. iOS also reminds users from time to time which apps use their location in the background.
To use location less often, set reducedLocationUsage to true. SwrveGeoSDK then:
- Relies on geofences alone, so iOS wakes your app only when the user enters or leaves one.
- Doesn't get a location each time your app opens. iOS still briefly uses location when SwrveGeoSDK sets up new geofences, for example after your geoplaces change.
The trade-off is that changes to your geoplaces reach users later. SwrveGeoSDK checks for them about once a day, and straight away when the user leaves the area your geofences cover:
- Default - When your app opens, the user enters or leaves a geofence, or the user travels about 500 meters.
- With
reducedLocationUsage- When your app opens, around the location SwrveGeoSDK last used, or when the user enters or leaves a geofence.
Geo campaigns aren't affected. SwrveGeoSDK refreshes them each time your app opens.
- iOS - Swift
- iOS - Objective-C
let geoConfig = SwrveGeoConfig()
geoConfig.reducedLocationUsage = true
SwrveGeoSDK.initWith(geoConfig)
SwrveGeoConfig *geoConfig = [[SwrveGeoConfig alloc] init];
geoConfig.reducedLocationUsage = YES;
[SwrveGeoSDK initWithConfig:geoConfig];
Custom filteringβ
To filter notifications or modify their content based on custom properties, you can set a custom filter when initializing SwrveGeoSDK.
- Android
- iOS - Swift
- iOS - Objective-C
SwrveGeoConfig geoConfig = new SwrveGeoConfig.Builder()
.customFilter((builder, id, properties) -> {
// add custom modifications if necessary or return null to suppress it
return builder.build();
})
.build();
// Initialize the SDK
SwrveGeoSDK.init(geoConfig);
// Set your custom filter logic
let config = SwrveGeoConfig()
config.customFilterDelegate = self
SwrveGeoSDK.initWith(config)
// Implement this method in the class that conforms to SwrveGeoCustomFilterDelegate
func filterNotification(_ notification: UNMutableNotificationContent, withCustomProperties customProperties: [AnyHashable: Any]) -> UNMutableNotificationContent? {
// Modify the notification or return nil to prevent the notification from displaying
return notification
}
// Set your custom filter logic
SwrveGeoConfig config = [[SwrveGeoConfig alloc] init];
config.customFilterDelegate = self;
[SwrveGeoSDK initWithConfig:config];
// Implement this method in the class that extends the SwrveGeoCustomFilterDelegate
- (UNMutableNotificationContent *)filterNotification:(UNMutableNotificationContent *)notification withCustomProperties:(NSDictionary *)customProperties {
// Modify the notification or return nil to prevent the notification from displaying
return notification;
}
Geoplace transition callbacksβ
When a customer enters or exits a geoplace, you might want to execute your own additional logic via geoplace transition callbacks. Configure the relevant platform callback as part of SwrveGeoConfig.
- Android
- iOS - Swift
- iOS - Objective-C
Implement the SwrveGeofenceTransitionListener callback.
SwrveGeoConfig geoConfig = new SwrveGeoConfig.Builder()
.geofenceTransitionListener((name, transition, triggerLocation, customProperties) -> {
// add custom code to execute upon enter/exit a geofence.
// Note this executes in same BroadcastReciever as Swrve code so has limitations.
return builder.build();
})
.build();
SwrveGeoSDK.init(this, geoConfig);
Note: Be aware that the SwrveGeofenceTransitionListener code runs in the same BroadcastReceiver as Swrve code. Create a separate worker thread from this to execute your own custom code.
Implement the SwrveGeofenceTransitionDelegate callback.
let config = SwrveGeoConfig()
config.swrveGeofenceTransitionDelegate = self
SwrveGeoSDK.initWith(config)
// Implement this method in the class that conforms to SwrveGeofenceTransitionDelegate
func triggered(_ name: String, transition: String, at location: CLLocation, customProperties: String?) {
// Handle the triggered geofence event here
}
Implement the SwrveGeofenceTransitionDelegate callback.
SwrveGeoConfig config = [[SwrveGeoConfig alloc] init];
config.swrveGeofenceTransitionDelegate = self;
[SwrveGeoSDK initWithConfig:config];
// Implement this method in the class that implements the SwrveGeofenceTransitionDelegate
- (void)triggered:(NSString *)name
transition:(NSString *)transition
atLocation:(CLLocation *)location
customProperties:(nullable NSString *)customProperties {
}
Testing your integrationβ
It's not always possible or practical to manually QA test geo-triggered campaigns, so in some instances you might want to use a simulator or emulator to test moving through a geographic location. This section explains how to trigger geoplaces from Android Studio and Xcode.
- Android Studio
- Xcode
Swrve Geo for Android is optimized to run in a battery-friendly manner, thus it doesn't use the GPS provider. The Android emulator runs only with GPS provider, so using the emulator location tools to test Swrve geoplace triggers requires a few extra steps. There are several methods to achieve this, but the easiest way is to allow the Google Maps app to get a location update and SwrveGeoSDK will passively use it in the background. The instruction below explain how to do this.
Preliminary setupβ
To test geoplace triggers in Android studio, first create an emulator and then add geoplaces in Swrve. Note: Some of the settings or locations referenced below may differ depending on the Android OS version you're using.
- Step 1: In Android Studio, open the Android SDK Manager and make sure SDK tools are up to date.
- Step 2: Open the Android Virtual Device (AVD) Manager and create your emulator Virtual Device with hardware that includes the Play Store (Google Play services).
- Step 3: Start the emulator and find the Security or Location settings.
- Step 4: Ensure the Location setting is on. Depending on the OS version, this might be located under Privacy.
- Step 5: Ensure Google Location Accuracy is in High Accuracy mode or Improve Location Accuracy is on. Depending on the OS version this is either under Location Mode, Advanced settings, or Improve Location Accuracy. This also requires accepting the Google location service policy when prompted.
- Step 6: If you're using an older emulator, you might need to update to Google Play Services. To do this, add a Google account to the emulator, open the Play store, and update all apps.
- Step 7: On the emulator, open Google maps to view the current location.
- Step 8: To change the location, open the emulator extended controls. On the Location tab, there's a map and button for setting the location. Set the desired location and verify Google Maps updates to the selected location.
- Step 9: In Swrve, add geoplaces for the locations you want to test. For information about creating geoplaces, see About geoplaces.
Testing geoplace triggersβ
- Step 1: In your Swrve SDK configuration, set the Logcat logging level to DEBUG. For more information, see How do I configure SDK device logging?
- Step 2: Install your app on the emulator and set it up as a QA device in Swrve. For information on setting up QA devices, see How do I set up QA devices?
- Step 3: Start SwrveGeoSDK and verify there's no geofencing errors in the Logcat console.
- If a message displays saying Google Play services are out-of-date, open the Play store and update all apps. Then restart your app.
- If Logcat displays ApiException 1000, it might indicate that Location services are not on, location accuracy is not in High Accuracy mode, or Improve Location Accuracy is not on.
- Step 4: Open Google Maps.
- Step 5: Open the emulator extended controls. On the Location tab there's a map and button for setting the location. Set the location to the center of a geoplace and debug logs will appear in Logcat about the trigger.
- Step 6: In Swrve, check the QA device logs. The QA User Logging screen should display information about the triggered geoplace. If the trigger was suppressed, the Geoplace Triggered event will include the reason.
Use Xcode's Simulate Location feature to test your geoplace triggers. On a simulator, use iOS 26 or earlier. The iOS 27 simulator doesn't support region monitoring, so geoplaces don't trigger.
Preliminary setupβ
To test geoplace triggers in Xcode, first define the locations in Xcode and then create matching geoplaces in Swrve.
Step 1: For each location, add GPX files to your Xcode project. For example:
- File name: apple_park.gpx
<?xml version="1.0"?>
<gpx version="1.1" creator="Xcode">
<wpt lat="37.335053" lon="-122.009103">
<name>Apple Park</name>
<time>2020-06-01T14:55:37Z</time>
</wpt>
</gpx>
- File name: cupertino_memorial_park.gpx
<?xml version="1.0"?>
<gpx version="1.1" creator="Xcode">
<wpt lat="37.325621" lon="-122.044625">
<name>Cupertino Memorial Park</name>
<time>2020-06-01T14:55:37Z</time>
</wpt>
</gpx>
Step 2: In Swrve, add corresponding geoplaces that match the latitude and longitude of your GPX files. For information about creating geoplaces, see About geoplaces.
Testing geoplace triggersβ
Step 1: Install your app on the simulator and set it up as a QA device in Swrve. For information on setting up QA devices, see How do I set up QA devices?
Step 2: Allow notifications for your app.
Step 3: In Xcode, simulate your initial location. On the Debug menu, select Simulate Location, and then select the desired location, for example, apple_park.
Step 4: In Xcode, start SwrveGeoSDK, allow location in the prompts, and verify there are no errors in the console. In the Settings app, check that Location shows Always, not While Using or Ask Next Time, and that Precise Location is on.
Step 5: In Swrve, the QA User Logging screen for your QA device should display a Geoplace Triggered event that includes information about the Apple Park geoplace. If the trigger is suppressed, the event includes the reason.
Step 6: In Xcode, simulate a location change. On the Debug menu, select Simulate Location, and then select the desired location, for example, cupertino_memorial_park. The device location should move from Apple Park to Cupertino Memorial Park.
Step 7: In Swrve, check the QA device logs. The QA User Logging screen should display information about the Apple Park geoplace exit and Cupertino Memorial Park geoplace enter events.
Next stepsβ
- Create the geoplaces you want to use to trigger geo-triggered campaigns. For more information, see About geoplaces.
- Create a push notification campaign that uses geoplaces as the campaign trigger. For more information, see Creating geo-triggered campaigns.
- View results and reports for your campaign or change the status. For more information, see Managing geo-triggered campaigns.