ConnectedDevicesPlatform Class

  • java.lang.Object
    • NativeBase
      • com.microsoft.connecteddevices.ConnectedDevicesPlatform

public class ConnectedDevicesPlatform

A class to represent the Connected Devices Platform and manage the app's connection to it.

Constructor Summary

Constructor Description
ConnectedDevicesPlatform(@NonNull Context context)

Creates and initializes a new instance of this class.

ConnectedDevicesPlatform(@NonNull Context context, @NonNull ConnectedDevicesPlatformSettings settings)

Creates and initializes a new instance of this class.

Method Summary

Modifier and Type Method and Description
ConnectedDevicesAccountManager getAccountManager()

Get ConnectedDevicesAccountManager instance held by the platform

ConnectedDevicesNotificationRegistrationManager getNotificationRegistrationManager()

Get ConnectedDevicesNotificationRegistrationManager instance held by platform

ConnectedDevicesProcessNotificationOperation processNotification(@NonNull Bundle bundle)

Process incoming GCM notification

ConnectedDevicesProcessNotificationOperation processNotification(@NonNull Map map)

Process incoming FCM notification

AsyncOperation<Void> processNotificationAsync(@NonNull ConnectedDevicesNotification notification)

Process incoming notification. If the notification is not for the ConnectedDevicesPlatform, the returned AsyncOperation will be completed in an asynchronous fashion as soon as possible.

AsyncOperation<Void> shutdownAsync()

Shuts down the Connected Devices Platform.

void start()

Start the platform

Constructor Details

ConnectedDevicesPlatform

public ConnectedDevicesPlatform(@NonNull Context context)

Creates and initializes a new instance of this class.

Parameters:

context - The context of the calling application. This is needed to expose app-specific resources to the ConnectedDevicesPlatform.

ConnectedDevicesPlatform

public ConnectedDevicesPlatform(@NonNull Context context, @NonNull ConnectedDevicesPlatformSettings settings)

Creates and initializes a new instance of this class.

Parameters:

context - The context of the calling application. This is needed to expose app-specific resources to the Connected Devices ConnectedDevicesPlatform.
settings - The PlatformSettings to construct the Platform object with

Method Details

getAccountManager

public ConnectedDevicesAccountManager getAccountManager()

Get ConnectedDevicesAccountManager instance held by the platform

Returns:

AccountManager

getNotificationRegistrationManager

public ConnectedDevicesNotificationRegistrationManager getNotificationRegistrationManager()

Get ConnectedDevicesNotificationRegistrationManager instance held by platform

Returns:

NotificationRegistrationManager

processNotification

public ConnectedDevicesProcessNotificationOperation processNotification(@NonNull Bundle bundle)

Process incoming GCM notification

Parameters:

bundle - The bundle received from GcmListenerService.onMessageReceived

Returns:

Result of processing a notification

processNotification

public ConnectedDevicesProcessNotificationOperation processNotification(@NonNull Map map)

Process incoming FCM notification

Parameters:

map - The bundle received from FirebaseMessagingService.onMessageReceived

Returns:

Result of processing a notification

processNotificationAsync

public AsyncOperation processNotificationAsync(@NonNull ConnectedDevicesNotification notification)

Process incoming notification. If the notification is not for the ConnectedDevicesPlatform, the returned AsyncOperation will be completed in an asynchronous fashion as soon as possible.

Parameters:

notification - The ConnectedDevicesNotification to process.

Returns:

An AsyncOperation operation indicating when the ConnectedDevicesPlatform is done processing this notification.

shutdownAsync

public AsyncOperation shutdownAsync()

Shuts down the Connected Devices Platform.

Returns:

An AsyncOperation<T> representing this operation.

start

public void start()

Start the platform

Applies to