Does DropBox on iOS have a URL scheme?

I would like to be able to run the DropBox application in my application. So I would like to know if there is a URL scheme in the DropBox application that I can use to call openURL, something like this, except that I do not know what this line should be.

NSURL *myURL = [NSURL URLWithString:@"dropbox://"]; [[UIApplication sharedApplication] openURL:myURL]; 
+5
source share
4 answers

The only thing you can do with the Dropbox URL scheme is to connect the Dropbox app to it. Like this:

 var key = "[YOUR API KEY]"; var secret = "[YOUR API SECRET]"; var apiversion = "1"; window.open("dbapi-1://"+apiversion+"/connect?k="+key+"&s="+secret); 

Usually the answers to the Dropbox-app, opening the iOS application with the following scheme:

 db-[YOU API KEY]://connect?oauth_token=SOMETOKEN&oauth_token_secret=SOMEOATHTOKEN&uid=SOMETHING 

or using:

 db-[YOU API KEY]://cancel 

Get it from viewing the Dropbox SDK for iOS.

+4
source

Dropbox URL Schema

 dbapi-1:// 
+3
source

If you need to open a specific file in the iOS Dropbox app, you can use this trick:

  • Encode URL.
  • Add the encoded URL to the dbapi-6://1/viewLink?url= prefix dbapi-6://1/viewLink?url= .

Caution: this is not documented and may change in future releases.

All code should look like this:

 // `yourURLString` is the URL string you want to open if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"dbapi-6://"]) { NSString *encodedFileURLString = [yourURLString stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; NSString *fullURLString = [@"dbapi-6://1/viewLink?url=" stringByAppendingString:encodedFileURLString]; [[UIApplication sharedApplication] openURL:[NSURL URLWithString:fullURLString]]; } else { // Otherwise open Safari [[UIApplication sharedApplication] openURL:[NSURL URLWithString:yourURLString]]; } 
+3
source

Dropbox does not have a URL scheme. However, you can interact with Dropbox through the UIDocumentInteractionController . You can read about it here . I have seen several applications that let you open files in Dropbox, and I assume that it was.

+2
source

Source: https://habr.com/ru/post/1397938/


All Articles