The Herow SDK allows your app to connect to the Herow platform.
The documentation is available for both platform.
What you will learn
You will learn to simulate your zone's entries or exits
Note: Prerequisites: You are supposed to have already configured the SDK. To do this, please refer to 5 minQuickstart You can refer to our dedicated tutorial
Pre-requisites - What you need to get started
- Your SDK credentials, including an SDK ID and SDK Key on Herow to initialize the SDK.
- A zone, which has been configured on your herow account.
- An iOS Device, with iOS 9 and above.
- The Xcode application, which you can download from the App store.
Mocking geofences with Herow
Set a campaign on Herow platform
- Connect you to the Herow Platform.
- Create a zone.
- Create a notification campaign associated to the zone.
- Don’t forget to launch the campaign !
Get the hash
Copy the hash of the zone you want to test
Implement the Mock system
- Open the AppDelegate.m file
For a foreground simulation
- Implement the HerowDetectionManager and the ** applicationWillEnterForeground** method of the AppDelegate and past the hash zone to process the mock system when the app is in foreground.
Switch to Swift
- (void) applicationWillEnterForeground:(UIApplication *)application {
NSInteger delay = 10000; // start emitting (entry) after 10 000 milliseconds
NSInteger stopdelay = delay + 10000; // stop emitting (exit) after 10 000 milliseconds after the entry
HerowDetectionManager * detectionManager = [HerowDetectionManager shared];
[detectionManager emitWithHash:@"my zones's hash" delay: delay];
[detectionManager stopEmittingWithDelay: stopdelay];
}
func applicationWillEnterForeground(_ application: UIApplication) {
let delay = 10000 // start emiting ( entry) after 10 000 milliseconds
let stopdelay = delay + 10000 // stop emiting ( exit) after 10 000 milliseconds after the entry
let detectionManager = HerowDetectionManager.shared
detectionManager.emit(hash: @"my zones's hash", delay: delay)
detectionManager.stopEmitting(delay: stopdelay)
}
For a background simulation
- Implement the HerowDetectionManager and the ** applicationDidEnterBackground** method of the AppDelegate to process the mock system when the app is in background.
Switch to Swift
- (void) applicationDidEnterBackground:(UIApplication *)application {
NSInteger delay = 10000; // start emiting ( entry) after 10 000 milliseconds
NSInteger stopdelay = delay + 10000; // stop emiting ( exit) after 10 000 milliseconds after the entry
HerowDetectionManager * detectionManager = [HerowDetectionManager shared];
[detectionManager emitWithHash:@"my zones's hash" delay: delay];
[detectionManager stopEmittingWithDelay: stopdelay];
}
func applicationDidEnterBackground(_ application: UIApplication) {
let delay = 10000 // start emiting ( entry) after 10 000 milliseconds
let stopdelay = delay + 10000 // stop emiting ( exit) after 10 000 milliseconds after the entry
let detectionManager = HerowDetectionManager.shared
detectionManager.emit(hash: @"my zones's hash", delay: delay)
detectionManager.stopEmitting(delay: stopdelay)
}
Generate your first mocked notification
Install the application
Accept the location permission and notification permission
Close your application or leave it running in the background
Wait the delay you had specified.
A notification should appear
Note:
To increase the efficiency of the Mock System , make sure that the campagn has geodetection set to off in the app settings section on Herow dashboard to avoid interferences between mock and real system.
Warning:
Think to make your application compliant with the GDPR, otherwise the SDK won't collect any data.
You can refer to our dedicated tutorial