OneSignal

Whenever events are generated, Radar will call the edit device API and send user attributes to OneSignal as tags. You can create notifications triggered by tag changes.

User mapping

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);
Radar User Field OneSignal Tag Name Type Example Tag Context Type
location.coordinates[1] lat number 39.525665
location.coordinates[0] long number -76.350663
segments[*].externalId radar_segment_external_ids string "starbucks-visitors"
topChains[*].slug radar_top_chain_slugs string "starbucks"
topChains[*].externalId radar_top_chain_external_ids string "123"
geofences[*]._id radar_geofence_ids string "5b2c0906f5874b001aecfd8e" Geofences
geofences[*].description radar_geofence_descriptions array[string] ["Store #123"] Geofences
geofences[*].tag radar_geofence_tags string "store" Geofences
geofences[*].externalId radar_geofence_external_ids string "123" Geofences
place._id radar_place_id string "59302bcf8f27e8a156bd4f91" Places
place.name radar_place_name string "Starbucks" Places
place.categories radar_place_categories string "coffee-shop" Places
place.chain.slug radar_place_chain_slug string "starbucks" Places
place.chain.name radar_place_chain_name string "Starbucks" Places
insights.state.home radar_insights_state_home boolean false Insights
insights.state.office radar_insights_state_office boolean false Insights
insights.state.traveling radar_insights_state_traveling boolean true Insights
country.code radar_region_country_code string "US" Regions
country.name radar_region_country_name string "United States" Regions
state.code radar_region_state_code string "MD" Regions
state.name radar_region_state_name string "Maryland" Regions
dma.code radar_region_dma_code string "26" Regions
dma.name radar_region_dma_name string "Baltimore" Regions
postalCode.code radar_region_postal_code string "21014" Regions