DropboxClient
public class DropboxClient : DropboxBase
The client for the User API. Call routes using the namespaces inside this object (inherited from parent).
-
Initialize a client with a static accessToken string. Use this method if your access token is long-lived.
Declaration
Swift
public convenience init( accessToken: String, selectUser: String? = nil, sessionConfiguration: NetworkSessionConfiguration? = nil, pathRoot: Common.PathRoot? = nil )Parameters
accessTokenStatic access token string.
selectUserId of a team member. This allows the api client to makes call on a team member’s behalf.
sessionConfigurationOptional custom network session configuration
pathRootUser’s path root.
-
Initialize a client with an
AccessTokenProvider. Use this method if your access token is short-lived. SeeShortLivedAccessTokenProviderfor a default implementation.Declaration
Swift
public convenience init( accessTokenProvider: AccessTokenProvider, selectUser: String? = nil, sessionConfiguration: NetworkSessionConfiguration? = nil, pathRoot: Common.PathRoot? = nil )Parameters
accessTokenProviderAccess token provider that wraps a short-lived token and its refresh logic.
selectUserId of a team member. This allows the api client to makes call on a team member’s behalf.
sessionConfigurationOptional custom network session configuration
pathRootUser’s path root.
-
Initialize a client with an
DropboxAccessToken.Declaration
Swift
public convenience init( accessToken: DropboxAccessToken, dropboxOauthManager: DropboxOAuthManager, sessionConfiguration: NetworkSessionConfiguration? = nil )Parameters
accessTokenThe token itself, could be long or short lived.
dropboxOauthManageran oauthManager, used for creating the token provider.
sessionConfigurationOptional custom network session configuration
-
Designated Initializer.
Declaration
Swift
public init(transportClient: DropboxTransportClient)Parameters
transportClientThe underlying DropboxTransportClient to make API calls.
-
Creates a new DropboxClient instance with the given path root.
Declaration
Swift
public func withPathRoot(_ pathRoot: Common.PathRoot) -> DropboxClientParameters
pathRootUser’s path root.
Return Value
A new DropboxClient instance for the same user but with an updated path root.
-
Fetches completed and running background tasks to be reconnected
Declaration
Swift
public func getAllRequests(completion: @escaping ([Result<DropboxBaseRequestBox, ReconnectionError>]) -> Void)Parameters
completionThe callback closure to recieve the reconnected requests or errors
-
Cancels all tasks and invalidates all network sessions
Declaration
Swift
public func shutdown()
View on GitHub
DropboxClient Class Reference