DBOfficialAppConnector

Objective-C

@interface DBOfficialAppConnector : NSObject

Swift

class DBOfficialAppConnector : NSObject

Manages returning to the official Dropbox app.

Note

This logic is for official Dropbox partners only, and should not need to be used by other third-party apps.
  • Full constructor.

    Declaration

    Objective-C

    - (nonnull instancetype)
           initWithAppKey:(nonnull NSString *)appKey
        canOpenURLWrapper:(nonnull BOOL (^)(NSURL *_Nonnull))canOpenURLWrapper
           openURLWrapper:(nonnull void (^)(NSURL *_Nonnull))openURLWrapper;

    Swift

    init(appKey: String, canOpenURLWrapper: @escaping (URL) -> Bool, openURLWrapper: @escaping (URL) -> Void)

    Parameters

    appKey

    The consumer app key of the current third-party API app.

    canOpenURLWrapper

    A wrapper around the [UIApplication canOpenURL] method call to ensure the SDK is app-extension safe.

    openURLWrapper

    A wrapper around the [UIApplication openURL] method call to ensure the SDK is app-extension safe.

    Return Value

    An initialized instance.

  • Returns to the Dropbox app specified by app

    Note

    This logic is for official Dropbox partners only, and should not need to be used by other third-party apps.

    Declaration

    Objective-C

    - (void)returnToDropboxApp:(nonnull DBOpenWithInfo *)openWithInfo
                changesPending:(BOOL)changesPending;

    Swift

    func `return`(toDropboxApp openWithInfo: DBOpenWithInfo, changesPending: Bool)

    Parameters

    openWithInfo

    Information retrieved from a shared UIPasteboard that is used to return to the official Dropbox app.

    changesPending

    Whether there are changes pending in Dropbox for the file.

  • Returns to the Dropbox app specified by app passing along the error and a dictionary of extra information.

    Note

    This logic is for official Dropbox partners only, and should not need to be used by other third-party apps.

    Declaration

    Objective-C

    - (void)returnToDropboxApp:(nonnull DBOpenWithInfo *)openWithInfo
                changesPending:(BOOL)changesPending
                     errorName:(nullable NSString *)errorName
                        extras:(nullable NSDictionary *)extras;

    Swift

    func `return`(toDropboxApp openWithInfo: DBOpenWithInfo, changesPending: Bool, errorName: String?, extras: [AnyHashable : Any]?)

    Parameters

    openWithInfo

    Information retrieved from a shared UIPasteboard that is used to return to the official Dropbox app.

    changesPending

    Whether there are changes pending in Dropbox for the file.

    errorName

    The error encoutered to pass back to the official Dropbox app.

    extras

    Extra information to pass back to the official Dropbox app.

  • Parses the url from the official Dropbox app into a DBOpenWithInfo object.

    Declaration

    Objective-C

    - (nullable DBOpenWithInfo *)openWithInfoFromURL:(nonnull NSURL *)url;

    Swift

    func openWithInfo(from url: URL) -> DBOpenWithInfo?

    Parameters

    url

    The url from the official Dropbox app used to open the SDK.

    Return Value

    Structured data parsed from the supplied url.

  • Determines whether an official Dropbox app is installed.

    Declaration

    Objective-C

    - (BOOL)isRequiredDropboxAppInstalled;

    Swift

    func isRequiredDropboxAppInstalled() -> Bool

    Return Value

    Whether an official Dropbox app is installed.

  • Retrieves from a shared UIPasteboard information used to return to the official Dropbox app.

    Note

    This logic is for official Dropbox partners only, and should not need to be used by other third-party apps.

    Declaration

    Objective-C

    + (nullable DBOpenWithInfo *)retriveOfficialDropboxAppOpenWithInfo;

    Swift

    class func retriveOfficialDropboxAppOpenWithInfo() -> DBOpenWithInfo?

    Return Value

    DBOpenWithInfo object that wraps the relevant information for returning to the official Dropbox app.