UserDataFeed Class

  • java.lang.Object
    • NativeBase
      • com.microsoft.connecteddevices.userdata.UserDataFeed

public class UserDataFeed

This class is responsible for synchronizing user-specific data with the Connected Devices Platform backend.

Method Summary

Modifier and Type Method and Description
int getDaysToSync()

Get the number of days to sync.

UserDataFeed getForAccount(@NonNull ConnectedDevicesAccount userConnectedDevicesAccount, @NonNull ConnectedDevicesPlatform platform, @NonNull String activitySourceHost)

Creates and initializes a new instance of this class with a user account, platform instance, and the cross-platform app ID.

UserDataFeedSyncStatus getSyncStatus()

Gets the current status of user data synchronization.

void setDaysToSync(@IntRange(from=0) int daysToSync)

Set the number of days to sync.

void startSync()

Starts the synchronization process with the Connected Devices Platform. During this operation, change events will be raised.

AsyncOperation<Boolean> subscribeToSyncScopesAsync(@NonNull Collection<UserDataFeedSyncScope> syncScopes)

Adds **UserDataFeedSyncScope** instances to this UserDataFeed. This UserDataFeed is synchronized according to the **UserDataFeedSyncScope** instances specified.

AsyncOperation<UserDataFeedSubscribeResult> subscribeToSyncScopesWithResultAsync( @NonNull Collection<UserDataFeedSyncScope> syncScopes)

Adds **UserDataFeedSyncScope** instances to this UserDataFeed. This UserDataFeed is synchronized according to the **UserDataFeedSyncScope** instances specified.

Event<UserDataFeed, UserDataFeedSyncStatusChangedEventArgs> syncStatusChanged()

Event for when the sync status of the UserDataFeed changes.

Method Details

getDaysToSync

public int getDaysToSync()

Get the number of days to sync.

Returns:

- Number of days of data to sync, which should be fewer than 30 0 represents the default value, which will be determined by the server

getForAccount

public static UserDataFeed getForAccount(@NonNull ConnectedDevicesAccount userConnectedDevicesAccount, @NonNull ConnectedDevicesPlatform platform, @NonNull String activitySourceHost)

Creates and initializes a new instance of this class with a user account, platform instance, and the cross-platform app ID.

Parameters:

userConnectedDevicesAccount - The user accound that this data will be associated with.
platform - The **ConnectedDevicesPlatform** instance that has been initialized for this app's Connected Devices functionality.
activitySourceHost - The cross-platform app ID. This is retrieved through the Microsoft Developer Dashboard registration (see Hosting cross-device experiences (Android)).

Returns:

A new instance of this class.

getSyncStatus

public UserDataFeedSyncStatus getSyncStatus()

Gets the current status of user data synchronization.

Returns:

A **UserDataFeedSyncStatus** instance describing the status.

setDaysToSync

public void setDaysToSync(@IntRange(from=0) int daysToSync)

Set the number of days to sync.

Parameters:

daysToSync - - Number of days of data to sync, which should be fewer than 30 0 represents the default value, which will be determined by the server

startSync

public void startSync()

Starts the synchronization process with the Connected Devices Platform. During this operation, change events will be raised.

subscribeToSyncScopesAsync

public AsyncOperation subscribeToSyncScopesAsync(@NonNull Collection syncScopes)

Adds **UserDataFeedSyncScope** instances to this UserDataFeed. This UserDataFeed is synchronized according to the **UserDataFeedSyncScope** instances specified.

Parameters:

syncScopes - Collection of **UserDataFeedSyncScope** instances.

Returns:

Result from the async operation

subscribeToSyncScopesWithResultAsync

public AsyncOperation subscribeToSyncScopesWithResultAsync( @NonNull Collection syncScopes)

Adds **UserDataFeedSyncScope** instances to this UserDataFeed. This UserDataFeed is synchronized according to the **UserDataFeedSyncScope** instances specified.

Parameters:

syncScopes - Collection of **UserDataFeedSyncScope** instances.

Returns:

Result from the async operation

syncStatusChanged

public Event syncStatusChanged()

Event for when the sync status of the UserDataFeed changes.

Returns:

The event subscription

Applies to