How to access user selected folder in iOS - ios

I'm looking for an iOS API that allows accessing a user-selected folder in place (without importing it). It seems to be possible with native frameworks from Apple. How I expect it to work:
User selects a folder using the native document picker.
App gets access to the folder and can read and write its content.
Access is persisted when the app is killed and restarted.
This functionality can be seen in the LumaFusion app. The feature is called "Linked Folders". It allows to add user-selected folders with a native document picker, which are then available for the app. The app can load assets from the previously selected folders. The content of the linked folders is not copied, so it's not an import. External changes to the content of linked folders are immediately visible in the app. Access to the folders is persisted, even if the app is killed and restarted, so the user won't have to choose the folder again.
Any hints of which API can be used to implement such a feature will be appreciated. I would also love to learn if there are any limitations, like the kind of the selected folders, will it work with any destination, including iCloud Drive and third-party file providers, etc. I believe it has to be documented somewhere but can't find the correct Apple Documentation page.

Not sure why I missed it previously, but it seems this documentation answers my question:
Providing Access to Directories
Use UIDocumentPickerViewController to get access to the user-selected directory URL.
Save the URL as a Bookmark for later using bookmarkData method.
Use startAccessingSecurityScopedResource and stopAccessingSecurityScopedResource methods when accessing the bookmarked URL content.

Related

How to allow the folder to be modified by the app only?

I've a strange requirement regarding for my app which using the Google Drive SDK. I'm creating a folder and a file(Single File) through app on the Google Drive. Now I want that folder to be modified by the app only. Is this feasible?
Why I need this?
I'm writing/syncing my app data to the user's drive. I'm creating a Folder and a file on the Drive.
Now the file can be modified by the user if he visit the Drive on browser or by some other medium.
So, If the file is modified, user will not be able to access his synced data on other devices.
I do not have my own server where I can store the data.
So, I want that file should be modified by the app only. How can I do this? Is this feasible with the current SDKs available? What else are the alternatives for me to get the project done?
Please Note : I do not have my own server.
I don't think this is feasible for the reason that I haven't read anything about it in the docs nor have I seen a working implementation of it.
The closest thing I can relate to this is Permissions for Shared Files's. But the restricting of file/folder happens to both browser and native app. They're always synced.
You can set the restricted folder to Reader role. Users will only be allowed to:
-Read the metadata (e.g. name, description) of the file or folder
-Read the content of the file
-Read the list of items in the folder
Check this iOS code on how to set the permissions.

How to allow user to upload attachments in iOS application

In case of Android when I want to send or attach a document such as a pdf or doc from my application I can easily access all the files in the external storage and share or attach.
But since iOS follows a sandbox approach as well as there is no filesystem so it is not possible to attach or upload in same manner.
In my iOS application right now, I have implemented Open In functionality, wherein in the info.plist file I have specified that my application supports all types of documents so when the user opens any documents he gets an option to Open In my application, then I save that document in the
Documents/Incoming
folder in the application, now when my user clicks to add attachment then he can see the document to attach, since this is a long process I was looking for better ones.
I saw whatsApp allows uploading/sharing from iCloud apart from that what can I do to provide a similar behaviour as Android.

App folder in Dropbox

In my application I want to fetch all audio files from Apps/App Folder using Dropbox api. I have used sync api and Datastore api but I am not able to create App folder inside 'Apps/'.
Please any one help me to find where I am wrong.
Thanks.
Once you authenticate the app within iOS it should create the folder for you, it's root dir would be '/'. As seen on their docs:
http://www.dropbox.com/developers/core/start/ios
Near the bottom? This will show you how to list all files.
EDIT:
From the link you gave me:
"With a file system in hand, you can start reading and writing files
(represented by a DBFile). If you're using the App folder permission,
your App Folder won't contain any files when a user first links with
your app, but it's easy to create one."
https://www.dropbox.com/developers/reference/devguide#app-permissions
"App folder
A dedicated folder named after your app is created within the Apps folder of a user's Dropbox. Your app gets read and write access to
this folder only and users can provide content to your app by moving
files into this folder. Your app can also read and write datastores
using the Datastore API."

Best place for saving user data for Windows Store App

Disclaimer: I am new to Windows Store App development.
My app is a Windows Store App (for desktop). The app has to create some content using user's input and the data can be considered as documents. Also, the document'd be in a proprietary format. The user should be able to see all those documents listed inside the app every time he launches it.
My question is where to save these document files. I have no issue it is directly accessible to users without using app (it is their data).
The document suggest roaming (limited storage) and local storage. But both are deleted once the app is deleted (bad for the user).
http://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx
Document also states that accessing right for My Document folder is granted only if the developer is a company (bad for me).
http://msdn.microsoft.com/en-us/library/windows/apps/hh464936.aspx
Any other popular pattern from developers (apart from Azure, SkyDrive and any online storage)?
On app's first launch, you can allow the user to choose his/her folder as per choice, and then add that folder in future access list. So you can access that folder anytime. Please check below given links.
How can I save a StorageFile to use later?
Exploring WinRT: Storage.AccessCache
Windows.Storage.AccessCache Classes

How to Impliment Browse functionality in ios

I want to Implement Browse functionality in my Ipad App.
Actually My requirement is,When i chick on button need to open the all document are existed in device same like as "widows my computer".After Browsing that document,Select any document and I need to Upload the selected document to server.
You only have access to the "sandbox" of your application. It is by default an empty folder. It is called the application documents folder (see here how to get it). Unfortunately, unless you have a jailbroken phone, you have (mostly) no access to other folders.
If you populate this folder with files you can certainly show them in your UI and send them to a server.

Resources