简体   繁体   中英

ios share extension - files from dropbox not loading correctly

When I try to load a shared item, the data that comes back is dropbox's login page - as if I weren't authenticated.

Here is the current method I am using to get the file data:

[itemProvider loadItemForTypeIdentifier:docType options:nil completionHandler:^(NSURL *url, NSError *error) {
    //my code
}];

doctype is an appropriate kUTType like kUTTypeImage or kUTTypeText, for example. The mimeType that we write the file with is correct to, per other files. It's the actual content loaded from dropbox (just a login page every time).

I have used other variations of the method (UIImage *, and NSData *) but get the same result for dropbox files.

Our shared extension works fine with files that are downloaded in apps like goodreader or Files. The problem arises when I try to share a file from the dropbox app. It gives me a url that I can put into any browser and it will take me to the file, so the url is not the problem.

Has anyone else faced this?

Here is an example link to a document that does this:

https://www.dropbox.com/s/qxkd1957qf7iq9x/04%20-%20Test%20Document.doc?dl=0

Thank you for your help on this Greg. I found that this worked instead by just changing the url and setting dl=1 like so

From: https://www.dropbox.com/s/qxkd1957qf7iq9x/04%20-%20Test%20Document.doc?dl=0

To https://www.dropbox.com/s/qxkd1957qf7iq9x/04%20-%20Test%20Document.doc?dl=1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM