Bluedot Tempo,
Android SDK version 15.3.0,
iOS SDK version 15.4.0 &
Canvas & Config API
released.
Details here.
Airship Android Integration
Table of Contents
Getting Started
Integrate your project with Airship SDK
1. Modify your build.gradle
to include Urban Airship and other dependencies.
repositories { ... maven { url "https://urbanairship.bintray.com/android" } } dependencies { ... // Urban Airship SDK implementation 'com.urbanairship.android:urbanairship-fcm:9.3.1' implementation 'com.google.firebase:firebase-messaging:17.3.4' }
UrbanAirship supports a few push providers: FCM, GCM, ADM. We recommend using Firebase. However, you can choose other.
2. Verify that the applicationId
is set in the project’s build.gradle
file.
android { ... defaultConfig { ... applicationId "com.example.application" } }
3. Add the airshipconfig.properties
to your application’s src/main/assets directory. (Note: You may have to create the src/main/assets directory.)
Download airshipconfig.properties
pre-populated with your Airship app key and secret or add it manually.
developmentAppKey = Your Development App Key developmentAppSecret = Your Development Secret productionAppKey = Your Production App Key productionAppSecret = Your Production Secret #Toggles between the development and production app credentials #Before submitting your application to an app store set to true inProduction = false #LogLevel is "VERBOSE", "DEBUG", "INFO", "WARN", "ERROR" or "ASSERT" developmentLogLevel = DEBUG productionLogLevel = ERROR fcmSenderId = FCM sender id
4. Start Urban Airship services by invoking takeOff
at the entry point in the application. To do so, you need to have a class that extends the Application class and set the name of that class for the application entry in AndroidManifest.xml
.
<
application
android:name
=
".CustomApplication"
... />
Then, override the application’s onCreate
to call UAirship.takeOff.
@Override public void onCreate() { super.onCreate(); UAirship.takeOff(this, new UAirship.OnReadyCallback() { @Override public void onAirshipReady(UAirship airship) { // Enable user notifications airship.getPushManager().setUserNotificationsEnabled(true); } }); }
Then, override the application’s onCreate
to call UAirship.takeOff.
@Override public void onCreate() { super.onCreate(); UAirship.takeOff(this, new UAirship.OnReadyCallback() { @Override public void onAirshipReady(UAirship airship) { // Enable user notifications airship.getPushManager().setUserNotificationsEnabled(true); } }); }
5. Add the FCM Sender ID to your airshipconfig.properties
. Your sender ID location is in the Cloud Messaging
tab in the Firebase Developer Console. See the FCM Setup documentation for detailed instructions on setting up FCM Sender ID.
fcmSender = Your Firebase Sender ID

You need to add your Project’s Server API key and Package name in Airship ( Settings > Services). See the FCM Setup documentation for detailed instructions on obtaining your API Key.
6. If there is no error then Build your project and you are ready to send your first test message.
Integrate Bluedot Point SDK in your Project
1. Add PointSDK-Android
module to your build.gradle
file
repositories { ... maven { ... url "https://urbanairship.bintray.com/android" } }
dependencies { ... implementation 'com.github.Bluedot-Innovation:PointSDK-Android:1.13.3' }
2. Add required permissions in AndroidManifest.xml
the file
<!-- General Point SDK functionality --> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" /> <uses-permission android:name="android.permission.VIBRATE" /> <usus-permissiom android:name="android.permission.FOREGROUND_SERVICE" />
In addition to the above permissions, the following services must be declared
<!-- General Point SDK functionality --> <service android:name="au.com.bluedot.point.net.engine.BlueDotPointService" android:exported="false"> </service> <service android:name="au.com.bluedot.point.net.engine.DataJobScheduler" android:exported="false" android:permission="android.permission.BIND_JOB_SERVICE"> </service> <service android:name="au.com.bluedot.point.net.engine.DataJobScheduler" android:exported="false" android:permission="android.permission.BIND_JOB_SERVICE" />
Interaction between Airship SDK and Bluedot Point SDK
Start Airship Services
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"/>
Setup Bluedot Location Services
1. Start PointSDK at the entry point in your application by overriding onCreate()
super.onCreate(); ... // start Point SDK intcheckPermissionCoarse = ActivityCompat.checkSelfPermission(getApplicationContext(), Manifest.permission.ACCESS_COARSE_LOCATION); intcheckPermissionFine = ActivityCompat.checkSelfPermission(getApplicationContext(), Manifest.permission.ACCESS_FINE_LOCATION); if(checkPermissionCoarse == PackageManager.PERMISSION_GRANTED && checkPermissionFine == PackageManager.PERMISSION_GRANTED) { serviceManager = ServiceManager.getInstance(this); if(!serviceManager.isBlueDotPointServiceRunning()) { // Setting Notification for foreground service, required for Android Oreo and above. // Setting targetAllAPIs to TRUE will display foreground notification for Android versions lower than Oreo serviceManager.setForegroundServiceNotification(createNotification(), false); serviceManager.sendAuthenticationRequest("Your Bluedot API key", this, false); } } else { requestPermissions(); }
3. Implement Point SDK callback
@Override public void onCheckIntoFence(FenceInfo fenceInfo, ZoneInfo zoneInfo, LocationInfolocationInfo, Map<String, String> customDataMap, boolean b) { ... } @Override public void onCheckedOutFromFence(FenceInfo fenceInfo, ZoneInfo zoneInfo, int dwellTime,Map<String, String> customDataMap) { ... }

Only Custom Actions
defined for a Zone will trigger Check-in and Check-out callbacks.
Check-out
does not apply to GEOLINE™.
Use Case
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.
Geofence or GEOLINE™: Geographical boundaries, two or more real-world geographical points created in Bluedot Point Access Dashboard
with Custom Action
. (Note: Checkout does not apply to GEOLINE™
)
@Override public void onCheckIntoFence(FenceInfo fenceInfo, ZoneInfo zoneInfo, LocationInfo locationInfo, Map<String, String> customDataMap, boolean b) { CustomEvent.Builder builder = new CustomEvent.Builder("bluedot_place_entered"); builder.setInteraction("location", zoneInfo.getZoneId()); builder.addProperty("bluedot_zone_name", zoneInfo.getZoneName()); if(customDataMap != null && !customDataMap.isEmpty()) { for(Map.Entry<String, String> data : customDataMap.entrySet()) { builder.addProperty(data.getKey(), data.getValue()); } } CustomEvent event = builder.build(); event.track(); } @Override public void onCheckedOutFromFence(FenceInfo fenceInfo, ZoneInfo zoneInfo, int dwellTime, Map<String, String> customDataMap) { { CustomEvent.Builder builder = new CustomEvent.Builder("bluedot_place_exited"); builder.setInteraction("location", zoneInfo.getZoneId()); builder.addProperty("bluedot_zone_name", zoneInfo.getZoneName()); if(customDataMap != null && !customDataMap.isEmpty()) { for(Map.Entry<String, String> data : customDataMap.entrySet()) { builder.addProperty(data.getKey(), data.getValue()); } } if(dwellTime != -1) { builder.addProperty("dwell_time", dwellTime); } CustomEvent event = builder.build(); event.track(); }
Start the discussion