iOS SDK 15.6.3,
Android SDK 15.4.1,
Hello Screen Dynamic States,
Bluedot Cordova plugin 4.0.1,
Bluedot Xamarin Android Wrapper 15.4.1,
Bluedot Xamarin iOS Wrapper 15.6.0,
Bluedot React Native wrapper 2.1.2,
Wave API.
Details here.
1. Start Airship services by overriding onCreate
in your custom Application class
super.onCreate(); UAirship.takeOff(this, new UAirship.OnReadyCallback() { @Override public void onAirshipReady(UAirship airship) { // Enable user notifications airship.getPushManager().setUserNotificationsEnabled(true); } }); }
Autopilot
configuration to AndroidManifest.xml
<meta-data android:name="com.urbanairship.autopilot" android:value="com.urbanairship.Autopilot"/>
1. Start PointSDK at the entry point in your application by overriding onCreate()
super.onCreate(); ... // start Point SDK boolean locationPermissionGranted = ActivityCompat.checkSelfPermission(getApplicationContext(), Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED; if (locationPermissionGranted) { serviceManager = ServiceManager.getInstance(this); if (!serviceManager.isBluedotServiceInitialized()) { InitializationResultListener resultListener = bdError -> { String text = "Initialization Result "; if (bdError != null) { text = text + bdError.getReason(); Log.i("Bluedot", text); } else { startGeoTriggering() } } serviceManager.initialize("<Your Bluedot Project ID>", resultListener); } } else { requestLocationPermissions(); }
2. Start Geo-triggering feature
public void startGeoTriggering() { // Start Geo-triggering feature GeoTriggeringService.builder() .start(this, geoTriggerError -> { if (geoTriggerError != null) { Log.i("Bluedot", "Error in starting GeoTrigger" + geoTriggerError.getReason()) } else { Log.i("Bluedot", "GeoTrigger started successfully") } }); }
3. Receiving Geo-trigger events
Create a receiver in the Manifest to receive Geo-trigger events (such as entering a location):
<application android:label="@string/app_name" > <receiver android:name="my.package.ExampleGeoTriggerReceiver" android:enabled="true" android:exported="false" > <intent-filter> <action android:name="io.bluedot.point.GEOTRIGGER" /> </intent-filter> </receiver> </application>
Implement the receiver
public class ExampleGeoTriggerReceiver extends GeoTriggeringEventReceiver { @Override public void onZoneEntryEvent(@NotNull ZoneEntryEvent entryEvent, @NotNull Context context) { ... } @Override public void onZoneExitEvent(@NotNull ZoneExitEvent exitEvent, @NotNull Context context) { ... } }
Exit
does not apply to GEOLINE™.
Objective: To trigger automated message
pushed to the user when their device checks in into Geofence
.
Setting Automated Message: Automated message to be setup via Urban Airship Dashboard
, to trigger when a new event is posted.
@Override public void onZoneEntryEvent@NotNull ZoneEntryEvent entryEvent, @NotNull Context context) { CustomEvent.Builder builder = new CustomEvent.Builder("bluedot_place_entered"); builder.setInteraction("location", entryEvent.getZoneInfo().getZoneId()); builder.addProperty("bluedot_zone_name", entryEvent.getZoneInfo().getZoneName()); Map<String, String> customData = entryEvent.getZoneInfo().getCustomData(); if (customDataMap != null) { for (Map.Entry<String, String> data : customData.entrySet()) { builder.addProperty(data.getKey(), data.getValue()); } } CustomEvent event = builder.build(); event.track(); } @Override public void onZoneExitEvent(@NotNull ZoneExitEvent exitEvent, @NotNull Context context) { { CustomEvent.Builder builder = new CustomEvent.Builder("bluedot_place_exited"); builder.setInteraction("location", exitEvent.getZoneInfo().getZoneId()); builder.addProperty("bluedot_zone_name", exitEvent.getZoneInfo().getZoneName()); Map<String, String> customData = exitEvent.getZoneInfo().getCustomData(); Int dwellTime = exitEvent.getDwellTime(); if (customDataMap != null) { for (Map.Entry<String, String> data : customData.entrySet()) { builder.addProperty(data.getKey(), data.getValue()); } } if (dwellTime != -1) { builder.addProperty("dwell_time", dwellTime); } CustomEvent event = builder.build(); event.track(); }