DJI Mobile SDK Documentation

      class DJIUserAccountManager

      @interface DJIUserAccountManager : NSObject
      Header:DJIUserAccountManager.h
      Inherits From:NSObject
      Description:

      Class used to manage the DJI account.

      Class Members:
      property loggedInDJIUserAccountName
      @property(nonatomic, readonly, nullable) NSString *loggedInDJIUserAccountName
      Header:DJIUserAccountManager.h
      Description:

      The name of the currently logged in user account. It is nil if userAccountState is either: DJIUserAccountStateNotLoggedIn, DJIUserAccountStateTokenOutOfDate or DJIUserAccountStateUnknown.

      property userAccountState
      @property (nonatomic, readonly) DJIUserAccountState userAccountState
      Header:DJIUserAccountManager.h
      Description:

      Current state of DJI user account.

      See Also:

      DJIUserAccountState

      method logIntoDJIUserAccountWithAuthorizationRequired:withCompletion
      -(void)logIntoDJIUserAccountWithAuthorizationRequired:(BOOL)authorizationRequired
      withCompletion:(DJIAccountStateCompletionBlock)completion
      Header:DJIUserAccountManager.h
      Description:

      After invoking this method, a dialog redirecting users to log into their DJI account will be shown. For 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 dialog will then redirect users to authorize their account.

      Input Parameters:
      BOOL authorizationRequiredYES if authorization is required.
      DJIAccountStateCompletionBlock completionThe execution block with the returned execution result.
      method logOutOfDJIUserAccountWithCompletion
      -(void)logOutOfDJIUserAccountWithCompletion:(DJICompletionBlock)completion
      Header:DJIUserAccountManager.h
      Description:

      Logs out the DJI user that is logged in.

      Input Parameters:
      DJICompletionBlock completionThe completion block with the returned execution result.
      typedef block DJIAccountStateCompletionBlock
      typedef void (^_Nullable DJIAccountStateCompletionBlock)(DJIUserAccountState state, NSError *_Nullable error)
      Header:DJIUserAccountManager.h
      Description:

      DJI Account State Completion Block.

      Input Parameters:
      DJIUserAccountState stateAn enum value of DJIUserAccountState.
      NSError *_Nullable errorError retrieving the value.
      enum DJIUserAccountState
      typedef NS_ENUM(uint8_t, DJIUserAccountState)
      Header:DJIUserAccountManager.h
      Description:

      User account status. Users need to be logged in.

      Enum Members:
      DJIUserAccountStateNotLoggedInUser is not logged in. User needs to be logged in to retrieve currently unlocked, and unlock authorization zones.
      DJIUserAccountStateNotAuthorizedUser is logged in but has not been authorized to unlock authorization zones.
      DJIUserAccountStateAuthorizedUser is logged in and has been authorized to unlock authorization zones.
      DJIUserAccountStateTokenOutOfDateThe token of the user account is out of date.
      DJIUserAccountStateUnknownUnknown.