Getting physical location of files in an IPad - ios

I am new to IOS App Development. I am working in an IOS app for IPad that will read a json file which will have names of some audio files. It will then play those files. I have copied the files into iPad using FilesOnTree App (http://download.cnet.com/FilesOnTree-FREE-Tree-File-Explorer/3000-2064_4-75748813.html). I can now only see the files in this app. I want my iPad app to access this data. For that I will need physical location of these files in iPad. Is there a way to get the physical location of files in iPad.
And after getting the address of files, will it be possible to access the files from my app.

You cannot access file outside of your App's Sandbox, except if the files are shared by the system (i.e. photo library and music files), after obtaining the proper permission from the user.
If these are music files, like you say, you can access them through MPMediaQuery
and play them back with MPMusicPlayerController

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

iOS Files App Registration with file types

I store video files in the Documents folder of my app. I need to present an option that enables users to copy video files from Documents folder to iOS Files app. I also want to automatically have a folder for my app in iOS files app (as seen in the screenshot).
I tried registering Document type "public.movie" (screenshot 2) but didn't help.
Wondering how to achieve it.

Is possible to save recorder audio file in musics in swift?

Hi in my app I have one feature to record audio and save it application directory. Client asking me is it possible to save audio file in musics?. That is client need to play recorded audio file without our application. I searched lot but cant find solution
No all iOS applications are sandboxed and the app data generated by the app cannot be used by other apps and can't to saved into other apps. The only way to share data between apps is through UIActivityViewController and it unfortunately does not provide any way of opening a file in music app. It is possible for jailbroken devices however.

How to export downloaded audio file(from within app folder) to user accessible music folder in IOS

I am using Xamarin to develop an IOS app. Here the user has an option to download audio files to the document folder within the app, and play it later on.
But i would like to provide an option for the user to access it in music folder or somewhere else, so that user does not have to come back to app to listen it.
Like we save images to camera roll, can we save mp3 or any other audio file to default music folder in IOS. Any solution or ideas using xamarin or xcode are welcome.
Note: I already know about File Sharing with itunes, i am looking for something else explained above.
As I know this isn't possible due to the limitations within iOS

How to choose files from iPhone?

In my app I have to upload files to server.
For that I need to view and choose files from my iPhone and iPad. (any kind of files i.e pdf , doc,dock , mp3 etc etc).
How can I get the path for these files and how can I choose them in my application.
Generally in iPhone Where are these files are stored? how we can fetch them in our application?
Is there any thing like UIImagePickerController to pick file from iPhone?
There are classes that allow you to interact with various media types that may be on an iOS based device.
As you mention UIImagePickerController.
For music, you can use a similar class: MPMediaPickerControllerDelegate.
With regard to other arbitrary documents;
There is no device-wide document store, and you cannot access files stored inside another app's app bundle, thus you cannot access saved PDF/doc files. There is no shared place for the user to save such PDFs in the first place. Which is why media libraries have specific APIs to access them because they are device-wide libraries.
The most you can do is register your app as a viewer of PDF documents. This would allow other apps to open a PDF in your app if they use a UIDocumentInteractionController.
Your best option is probably to use File Sharing which will allow your application to own files on the device which can be synced via iTunes.
This will enable you to create your own UI, to present these files from your applications document folder.
Further reading: iOS File System Basics, File System Programming Guide.

Resources