I need some sort of file sharing functionality between two independent apps (cannot use AppGroup or something like that).
App1 should send to App2 n documents (n could be hundreds), App2 should elaborate these documents and send back to App1 the elaborated documents. I would like minimal user interaction (so I wouldn't use the UIActivityViewController or similar solutions)
By now I'm using custom url to allow the applications to call themselves, and the general UIPasteboard to share the documents. But since I have no control on the number or the size of the documents, I'm worried that this solution wouldn't be reliable
So I'm taking a look at the sharing features introduced in iOS 11, and I can see that using
UISupportsDocumentBrowser = TRUE
into App1's plist, I can share all the documents directory with Files app or with any document based app.
But I cannot understand if I can get the files from App1's documents folder with some sort of API, without using UIDocumentBrowserViewController.
Something like:
App1 set UISupportsDocumentBrowser,LSSupportsOpeningDocumentsInPlace,UIFileSharingEnabled = true and share its document folder
App1 call App2's custom url with a list of url of files that are inside App1's document folder
App2 launches and get the files reading from these urls (that are accessible because App1 share its document folder)
Does Anyone know if it's possible and there is an API to do this?
I have already tried to set UISupportsDocumentBrowser,LSSupportsOpeningDocumentsInPlace,UIFileSharingEnabled = TRUE in App1 and simply tried, from App2, to read a file url from inside App1's documents folder with Data(contentsOf: url), but this doesn't work (no read permissions)
Thanks to all!
Related
So , I have setup my project and I am planning to self serve my files from my server. Currently I have two folders from where I want users to access files , 1. Media folder and another is static folder . I wanna set up signed urls just like S3 provides so that one cannot bruteforce and get all my files from the server's either folders. Also I want to make it so that I can handle uploading of files directly from nginx rather than through my application.
For the signed URLS - need to generate them with your application. Then you have two options:
Serve the files with your application after validating the URL is valid
Serve the files with nginx but do the validation/authorization with your app. This is what you need:
http://nginx.org/en/docs/http/ngx_http_auth_request_module.html#auth_request
For the upload part the situation is similar, you can either:
Handle uploads with your app
Use nginx-upload-module and handle the authorization only with your app
I would definitely recommend handling all uploads within your app, it is just simpler.
Photos Framework provides an API to move to folders. But, is there a way to change the status of an image to hidden, and thereby move it to the iOS Hidden folder and hiding it from the main photo gallery?
If you want to save some data privately so no other app could access it you probably need to save it into the app data container. This could be a /Documents folder for example. Take a look at FileManager class to work with file system.
Use this directory to store user-generated content. The contents of this directory can be made available to the user through file sharing; therefore, his directory should only contain files that you may wish to expose to the user.
The contents of this directory are backed up by iTunes and iCloud.
File system documentation
I am developing an iOS app that uses a large amount of images that are needed for animations for short videos. I want to save my application assets as static files in cloud and once they are needed download them using secure API call (either JSON, XML or any other alternative for that matter).
What is the best option for that. I have checked Parse, Dropbox, iCloud, Google Drive, but I am puzzled since I see only instructions for dynamic data that lets users access content they have created and not static assets.
What would be best option for that?
If you just want an easy way to serve static files I would take a look at Amazon S3. You can just upload files through the online console and then get the public URL to those files to use in your app. You can also use the S3 API to upload files through your web service or iOS app.
Hope this helps!
I'd go for Parse (basically because it is fast to learn and develop), you can create a table with the images and change the writing permissions if you are afraid somebody could modify the table.
Another option that you can check it's the special Config table so you can upload custom files (zip files i.e.) and download them in demand.
I want to allow users of my app to send PDF which is in the device.
The problem is, I don't see how to do that...
First, where are the files downloaded ? In which directory ? And how to list these files ?
I see there is NSfileManager but I don't understand how to use that.
I want something like DocumentPicker. (but available for iOS 7)
There is no common central directory in iOS that stores PDF files in way you describe. Nothing.
Each app has its own Documents folder, and apps have absolutely no way to see each others docs folder. So you, as a new pdf manager custom written app will not be able to look into other apps docs folder.
NSFileManager is a standard Cocoa class the handles files in a generic manner.
I wanted to share a folder using DropBox Sync Api.
So I called this function to get the link of the file/folder.
- (NSString *)fetchShareLinkForPath:(DBPath *)path shorten:(BOOL)shorten error:(DBError **)error
Getting the link of the file is not a problem.
But whenever I want to get the folder's link I get this.
[WARNING] ERR: DROPBOX_DISALLOWED: sync.hpp:300: app is not allowed to share folder p(/e9/p8)
Does anyone have an idea why this happens? Or is there a permission type that I am missing?
Here's my setup
Files and datastores
No - My app needs access to files already on DropBox
Specific file types My app only needs access to certain file types, like text or photos.
Images JPEG, GIF, SVG, RAW, etc.
'Name'
I tried searching for possible answers and I think I need stackoverflow pip's help on this one 'cause I can't find the right one.
Your app only has access to certain file types, but you're trying to share an entire folder. What if that folder contains files that your app can't access? I believe that apps with File type permissions currently cannot share folders at all for this reason. (They also can't move or delete folders.)