ConnectedDevicesPlatform 类

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

public class ConnectedDevicesPlatform

一个类,用于表示连接的设备平台并管理应用与其的连接。

构造函数摘要

构造函数 说明
ConnectedDevicesPlatform(@NonNull Context context)

创建并初始化此类的新实例。

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

创建并初始化此类的新实例。

方法摘要

修饰符和类型 方法和描述
ConnectedDevicesAccountManager getAccountManager()

获取平台持有的 ConnectedDevicesAccountManager 实例

ConnectedDevicesNotificationRegistrationManager getNotificationRegistrationManager()

获取平台持有的 ConnectedDevicesNotificationRegistrationManager 实例

ConnectedDevicesProcessNotificationOperation processNotification(@NonNull Bundle bundle)

处理传入的 GCM 通知

ConnectedDevicesProcessNotificationOperation processNotification(@NonNull Map map)

处理传入的 FCM 通知

AsyncOperation<Void> processNotificationAsync(@NonNull ConnectedDevicesNotification notification)

处理传入通知。 如果通知不是 ConnectedDevicesPlatform,则返回的 AsyncOperation 将以异步方式尽快完成。

AsyncOperation<Void> shutdownAsync()

关闭连接的设备平台。

void start()

启动平台

构造函数详细信息

ConnectedDevicesPlatform

public ConnectedDevicesPlatform(@NonNull Context context)

创建并初始化此类的新实例。

参数:

context - 调用应用程序的上下文。 这需要向 ConnectedDevicesPlatform公开特定于应用的资源。

ConnectedDevicesPlatform

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

创建并初始化此类的新实例。

参数:

context - 调用应用程序的上下文。 这需要向 Connected Devices ConnectedDevicesPlatform 公开特定于应用的资源。
settings - 使用 构造 Platform 对象的 PlatformSettings

方法详细信息

getAccountManager

public ConnectedDevicesAccountManager getAccountManager()

获取平台持有的 ConnectedDevicesAccountManager 实例

返回:

AccountManager

getNotificationRegistrationManager

public ConnectedDevicesNotificationRegistrationManager getNotificationRegistrationManager()

获取平台持有的 ConnectedDevicesNotificationRegistrationManager 实例

返回:

NotificationRegistrationManager

processNotification

public ConnectedDevicesProcessNotificationOperation processNotification(@NonNull Bundle bundle)

处理传入的 GCM 通知

参数:

bundle - 从 GcmListenerService.onMessageReceived 接收的捆绑包

返回:

处理通知的结果

processNotification

public ConnectedDevicesProcessNotificationOperation processNotification(@NonNull Map map)

处理传入的 FCM 通知

参数:

map - 从 FirebaseMessagingService.onMessageReceived 收到的捆绑包

返回:

处理通知的结果

processNotificationAsync

public AsyncOperation processNotificationAsync(@NonNull ConnectedDevicesNotification notification)

处理传入通知。 如果通知不是 ConnectedDevicesPlatform,则返回的 AsyncOperation 将以异步方式尽快完成。

参数:

notification - 要处理的 ConnectedDevicesNotification。

返回:

AsyncOperation 操作,指示 ConnectedDevicesPlatform 何时完成处理此通知。

shutdownAsync

public AsyncOperation shutdownAsync()

关闭连接的设备平台。

返回:

表示此操作的 AsyncOperation<T>

start

public void start()

启动平台

适用于