How to pick(picker view) any files from ios device using objective c? - ios

I was developing an ios application for file backup. In that I need to list and enable user to pick up files from any folder and need to do email backup like media and image picker.
I am struckup here with a bottle neck. I can't triger populating the list of document and email list for the user to pick. I had tried many codes, but it is not working.
I was working with the simulator.
Could anyone share their insight?
Regards

You should be more precise : do you want to pick up any file from any application on your device or just in your application library folder ? You can't access others applications folders.
You can find more information about the file system here :
https://developer.apple.com/library/mac/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/FileSystemOverview/FileSystemOverview.html

iPhone do not have a file browser.
The only place that a iPhone app can take file is from photo album.
Every application keeps its files in its private place.

Related

How to Flutter write files to iOS iPhone "Find on my phone" Folder

My goal is to allow my app user write and read files created by my app. For example, write and then allow the user to email a .CSV file of data, or a .GPX file of location data. And on the other end, import a file back into my application.
I have successfully deployed an Android version of my app (Plant List GPS) which uses Flutter plugin path_provider 1.6.10. On Android, I successfully use external directories, but this external directories solution is not available/allowed for iOS. I find on iOS I can create subfolders and write to the getApplicationDocumentsDirectory, but when I try to find/read that file from a file picker solution, it cannot be seen. I understand this is proper behavior to protect sensitive app files in this folder location.
I also understand that iOS has the concept of an app Sandbox and appreciate its objectives. I'm not trying to defeat it, but find a way to access/use it in my Flutter app. I have played around in writing test data files to various places on the iOS file system using the iPhone 11 simulator on my MacBook, but can not get any file to appear in the phone "Find on my phone" dialog.
Any help in solution approach or technique is appreciated.
I think you need to add both the keys into info.plist, and then files from your app directory will be visible on Files app!
LSSupportsOpeningDocumentsInPlace
UIFileSharingEnabled

Create a file through a Cordova/Phonegap app that can be opened by another app (ios)?

I'm able to create and save files using cordova-plugin-file, and have been saving and accessing them from within the app to cordova.file.documentsDirectory.
The problem it seems is that all the directories that one can save to are private, Cordova-plugin-file documentation
I would like to be able to have these files saved in (or moved to) the ios blue "files" folder, so that they can be opened by other apps such as Numbers, Pages, etc. It seems so simple there has to be a way to do this, but I can't find it after more than a few evenings of searching and trying different ways.
I'd be grateful if someone could point me in the right direction.
From what I can tell you can save to the documents directory "cordova.file.documentsDirectory". By default this directory is shared with iCloud, so a file saved here could be opened through the ios File folder and a user could then select the files and hit the share icon to open with the appropriate app, such as Numbers etc.
In order to turn on iCloud you have to pay the developer fee to Apple and select the options to do so. I found the article "Working with the Files App in iOS 11" to be helpful in starting this process.
I don't have the paid developer account yet, but from what I'm reading it should work once I activate one. I'm open to a better solution or critique.

How detect changes in the application documents directory in iOS app?

I am currently working on an app with the file sharing feature.
We have a view to ask the user to plug his device to iTunes to add files if there is no files in the app.
I would like to remove this view when the iOS app is launched on the device and when the user add at least one file with iTunes to the app.
Is there a way to do that with the default FileManager ? Like a delegate or something to detect events from the document directory of the app ?
I have looked on the web and found some pods but only for macOS.
I have also tried something with a Timer which will get the files from the document directory of the app each 0.25 seconds, but I don't think this is the best way to do what I want.
Thanks for your help.
EDIT:
Thanks to the MartinR's comment below, the following link helps me to do what I wanted
Notification if user modifies contents of documents directory via iTunes File sharing

Is there a way to open an editor app in ios and receive edited results?

I have an app that downloads files from a web server. Our customer wants the ability to edit those files on their mobile devices and upload the edited version to our servers. Is this possible in iOS? I have figured out how to allow users to view the files in external apps, but I don't see a way to bring back their changes if the file was modified as it seems to copy the file into the other app's space, so my app is left with the unaltered version.
iOS has a sandbox mechanism, so for sure you can not modify any file in another app.
The only way to transfer data from different app is using sharing.
This is a sample project I wrote for implement sharing on iOS, check it:
Sample for sharing on iOS
Hope it can help you.

How can you import text files into an iPad application?

For a school project, I am writing an iOS iPad application in which the user is capable of inputting sentences into core data that are used elsewhere in the system; however, my professor has now asked for another feature in which the user is capable of somehow entering sentences from some other interface than the iPad's keyboard. For instance, the most desirable solution is to be able to write sentences into text files and import them into the application through iTunes.
I have seen a few different apps capable of receiving files through iTunes, such as the VLC app in which the user can place videos into the VLC app's video storage. This allows VLC to then load the videos. I'm wondering if there is a good way or even if it's possible to do this with text files in my app, so that I may then read them into core data.
Thanks,
Chris
This is possible... First of all you need to add a value to your info.plist file which enables iTunes file sharing (like with VLC etc.) "UIFileSharingEnabled -> YES"
Then you can store files through iTunes. These files are put into your applications "Documents" - directory... When launching your application, you will need to check if new files are available and handle these changes...
You can also add document types / extensions, so that when you are sent an email with a txt file, it can be opened with your application. How do I register a custom filetype in iOS

Resources