DJI Windows SDK Documentation

class UserAccountManager

sealed class UserAccountManager
Declaration:DJI.WindowsSDK.UserAccount
Description:

Class used to manage DJI user account.

Class Members:
enum UserAccountState
enum UserAccountState
Declaration:DJI.WindowsSDK.UserAccount
Description:

States of the user account.

Enum Members:
NotLoggedInNo user account is logged in yet.
NotAuthorizedThe user is logged but has not been authorized to unlock authorizaton zones.
AuthorizedThe user is logged and has been authorized to unlock authorizaton zones.
TokenOutOfDateThe token of the user account is out of date.
UnknownUnknown.
delegate AccountStateChangedEventHandler
delegate void AccountStateChangedEventHandler(UserAccountState state, SDKError error)
Declaration:DJI.WindowsSDK.UserAccount
Description:

A delegate type used to subscribe the changes of the user account state and the error when login fails.

event UserAccountStateChanged
event AccountStateChangedEventHandler UserAccountStateChanged
Declaration:DJI.WindowsSDK.UserAccount
Description:

Subscribe the event to receive changes of the user account state and the error when login fails.

property
property AccountName
String AccountName { get; }
Declaration:DJI.WindowsSDK.UserAccount
Description:

The user account name of the logged in user. An emtpy string is returned if no user logged in.

See Also:

AccountName

property UserAccountState
UserAccountState UserAccountState { get; }
Declaration:DJI.WindowsSDK.UserAccount
Description:

The user account state.

method ~UserAccountManager
~UserAccountManager()
Declaration:DJI.WindowsSDK.UserAccount
Description:

The desctructor of the manager. It should not be called.

method CreateLoginView
WebView CreateLoginView(bool authorizationRequired)
Declaration:DJI.WindowsSDK.UserAccount
Description:

After invoking this method, a webview redirecting users to log into their DJI account will be created. The life cycle and the visibility of the webview is controlled by the developer. For end users outside of China, authorization is required to unlock authorization zones. After the login process, if authorizationRequired is YES, and the user is currently out of China and the account has not been authorized to unlock authorization zones, the webview will then redirect users to authorize their account.

Input Parameters:
bool authorizationRequiredIf authorization is needed. If so, the view will jump to the authorization page after login.
Return:
WebViewA webview that contains the login page.
method
method Logout
async Task<SDKError> Logout()
Declaration:DJI.WindowsSDK.UserAccount
Description:

Logs out the DJI user that is logged in.

Return:
async Task<SDKError>A Task that returns the logout result asynchronously.