The AirWatch SDK receives commands from the Workspace ONE UEM console through the implementation of a class which extends the AirWatchSDKBaseIntentService.

  1. Register the receiver.

    In order for your SDK app to listen for these commands, register the receiver in your Android Manifest file. You can do that by adding the following excerpt to your manifest.

     

    <uses-permission android:name="com.airwatch.sdk.BROADCAST" />
                            <receiver
                            android:name="com.airwatch.sdk.AirWatchSDKBroadcastReceiver"
                            android:permission="com.airwatch.sdk.BROADCAST" >
                            <intent-filter>
                            <!-- Replace your app package name here -->
                            <action android:name="<packagename>.airwatchsdk.BROADCAST" />
                            </intent-filter>
                            <intent-filter>
                            <action android:name=“com.airwatch.intent.action.APPLICATION_CONFIGURATION_CHANGED”
                            />
                            <data android:scheme=“app” android:host=<packagename> />
                            </intent-filter>
                            <intent-filter>
                            <action android:name="android.intent.action.PACKAGE_ADDED" />
                            <action android:name="android.intent.action.PACKAGE_REMOVED" />
                            <action android:name="android.intent.action.PACKAGE_REPLACED" />
                            <action android:name="android.intent.action.PACKAGE_CHANGED" />
                            <action android:name="android.intent.action.PACKAGE_RESTARTED" />
                            <data android:scheme="package" />
                            </intent-filter>
                            </receiver>
                            
                            
                            
                         
  2. Receive the callback methods.

    Create a class named AirWatchSDKIntentService which extends AirWatchSDKBaseIntentService in the app package path to receive the callback methods.

    package com.sample.airwatchsdk;
                            
                            import ...
                            
                            public class AirWatchSDKIntentService extends AirWatchSDKBaseIntentService {
                            
                            @Override
                            protected void onApplicationConfigurationChange(Bundle applicationConfiguration) {
                            
                            }
                            
                            @Override
                            protected void onApplicationProfileReceived(Context context, String profileId, 
                            ApplicationProfile awAppProfile) {
                            }
                            
                            @Override
                            protected void onClearAppDataCommandReceived(Context context, ClearReasonCode reasonCode)
                            {
                            }
                            
                            @Override
                            protected void onAnchorAppStatusReceived(Context context, AnchorAppStatus awAppStatus)
                            {
                            }
                            
                            @Override
                            protected void onAnchorAppUpgrade(Context context, boolean isUpgrade) {
                            }
                            }
                            
                            
                            
                         

     

  3. Register the intent service in your manifest.

    <service android:name="<packagepath>.AirWatchSDKIntentService" />