Notifications
Use Radar's on-premise notifications to display a notification on iOS devices when a user enters a geofence. Notifications work even with only foreground or "when in use" permissions!
#
QuickstartFirst, sign up for Radar and get an API key.
Then, create geofences via the dashboard, CSV import, or the API.
From there, add values for the following metadata
keys to the geofences that will trigger notifications.
#
Metadata keysradar:notificationText
(string, required): The body text of the notification.radar:notificationTitle
(string, optional): The title of the notification, displayed in bold.radar:notificationSubtitle
(string, optional): The subtitle of the notification, displayed in bold.radar:notificationRepeats
(boolean, optional): Determines whether the notification should be delivered multiple times before notifications are registered again. Defaults tofalse
.
Finally, integrate the SDK and call Radar.trackOnce()
or Radar.startTracking()
, depending on your use case. Make sure that the syncGeofences
tracking option is enabled. Radar will display a notification when the device is detected inside a geofence that has the above metadata
keys.
#
How it worksRadar's on-premise notifications make use of location notification triggers on iOS. These triggers work with foreground or "when in use" permissions. This feature is privacy-friendly and won't collect any additional location data. Notifications are only displayed after the user opens the app for the first time with the Radar SDK installed.
No additional lines of code are necessary to power on-premise notifications. They function completely under the hood after setup. The same calls to Radar.trackOnce()
and Radar.startTracking()
will return nearby geofences with notifications, which will then be registered on the device.
Radar only controls the registration of notifications on the device. Once that happens, surfacing notifications is subject to the system limits and heuristics that iOS enforces.
#
AnalyticsWith Radar Conversions, you can log an event whenever a user interacts with a notification.
Add the following line to your UNUserNotificationCenterDelegate
implementation to instrument opened_notification
events.
extension AppDelegate: UNUserNotificationCenterDelegate { func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) {
Radar.logConversion(request: response.notification.request) }}
#
SupportHave questions? We're here to help! Email us at support@radar.com.