Skip to main content

OneSignal

Radar can send tags to and trigger notifications in OneSignal. You can create notifications triggered by tag changes.

Use the OneSignal integration to send location-triggered and location-targeted messages to increase engagement and conversion.

The OneSignal integration is available on the Team plan or higher.

Configuration#

On the OneSignal Settings page under Keys & IDs, copy your REST API key.

Then, on the Radar Integrations page under OneSignal, set Enabled to Yes and paste your API key. Note that you can set separate API keys for the Test and Live environments.

Whenever events are generated, Radar will call the edit device API and set tags in OneSignal. You can create notifications triggered by tag changes.

By default, Radar userId and deviceId do not map to OneSignal. To map users in Radar to devices in OneSignal, you must send the OneSignal player ID to Radar by setting metadata.oneSignalPlayerId. For example, on iOS:

let playerId = OneSignal.getPermissionSubscriptionState().subscriptionStatus.userId
Radar.setMetadata(["oneSignalPlayerId": playerId])

On Android:

String playerId = OneSignal.getPermissionSubscriptionState().getSubscriptionStatus().getUserId();
JSONObject metadata = new JSONObject();
metadata.put("oneSignalPlayerId", playerId);
Radar.setMetadata(metadata);

User mapping#

Radar User FieldOneSignal Tag NameTypeExample TagContext Type
location.coordinates[1]latnumber39.525665
location.coordinates[0]longnumber-76.350663
segments[*].externalIdradar_segment_external_idsstring"starbucks-visitors"
topChains[*].slugradar_top_chain_slugsstring"starbucks"
topChains[*].externalIdradar_top_chain_external_idsstring"123"
geofences[*]._idradar_geofence_idsstring"5b2c0906f5874b001aecfd8e"Geofences
geofences[*].descriptionradar_geofence_descriptionsstring"Store #123"Geofences
geofences[*].tagradar_geofence_tagsstring"store"Geofences
geofences[*].externalIdradar_geofence_external_idsstring"123"Geofences
place._idradar_place_idstring"59302bcf8f27e8a156bd4f91"Places
place.nameradar_place_namestring"Starbucks"Places
place.categoriesradar_place_categoriesstring"coffee-shop"Places
place.chain.slugradar_place_chain_slugstring"starbucks"Places
place.chain.nameradar_place_chain_namestring"Starbucks"Places
insights.state.homeradar_insights_state_homebooleanfalseInsights
insights.state.officeradar_insights_state_officebooleanfalseInsights
insights.state.travelingradar_insights_state_travelingbooleantrueInsights
country.coderadar_region_country_codestring"US"Regions
country.nameradar_region_country_namestring"United States"Regions
state.coderadar_region_state_codestring"MD"Regions
state.nameradar_region_state_namestring"Maryland"Regions
dma.coderadar_region_dma_codestring"26"Regions
dma.nameradar_region_dma_namestring"Baltimore"Regions
postalCode.coderadar_region_postal_codestring"21014"Regions
trip.externalIdradar_trip_external_idstring"123"Trip tracking
trip.destinationGeofenceTagradar_trip_destination_geofence_tagstring"store"Trip tracking
trip.destinationGeofenceExternalIdradar_trip_destination_geofence_external_idstring"123"Trip tracking
trip.approachedradar_trip_approachedbooleantrueTrip tracking
trip.arrivedradar_trip_arrivedbooleanfalseTrip tracking