ios copy file to another apps file directory - ios

Is there anyone that got an idea of how to copy files to another apps file directory in ios? I need a service for this so I can from my app simply hit a button and what my app does is copy a file to another apps directory? will that be possible? I am ready to pay for a person that can help me with this?

iOS apps are sandboxed and are not able to directly access the contents of another app's data. There are ways for apps to interact with each other, but these require user interaction and are limited to specific use cases. For more info, here are some docs from Apple on inter-app communication:
Document Interaction Programming Topics for iOS
Inter-App Communication

Related

How safe is to store files into the document directory?

I am writing an iOS app in Swift and Xcode where I allow users to download some files from a server and to store them into the iPhone's document directory.
How safe is it to do so?
Is it possible for a user to access one of these files from outside the app, for example by connecting their phone to a computer, and move them around or share them? If a user has a jailbroken iPhone, could he get a way to access the downloaded files in other ways other than the one I allow within my app?
And if so, should I encrypt my files when I download them?
For jailbroken iPhone i think yes it's possible to access apps directories.
For normal iPhone I'm pretty sure other apps can't access it as all third-party apps are “sandboxed"
https://support.apple.com/en-gb/guide/security/sec15bfe098e/web#:~:text=Sandboxing,information%20stored%20by%20other%20apps.
And no idea about connecting their phone to a computer.

iOS, config files and sandboxing

My understanding is that because of sandboxing, it isn't possible to view any text file (ie config file) associated with an iOS app using another app. Something quite simple with Android. Am I mistaken?
I am trying to implement a text config file with a Unity iOS app that gets loaded and parsed once when the application boots.
This config file would also be able to be edited and saved manually on that actual iOS device.
(addendum)
In Unity there is PersistentDataPath which resolves to /var/mobile/Container/Data/Application/foo/Documents
Is there an iOS supported file explorer app that will allow me view and edit files in this location (without jailbreaking)?
Use can check iOS App Groups. It allows multiple apps access to shared containers and allow interprocess communication. There is no so much documentation about this, but maybe that's what you're looking for. At least you can share NSUserDefaults between the apps.
NSUserDefaults it's a most simple way to save any (not big) configurations for your app. For manual editing: if your app on the device signed with developer certificate, you can connect through any iOS supported file explorer app and edit it. But after release, from App Store, your app installed in restricted/private path, so it's not possible, if only you don't have a jailbreak.
Initial configuration you can put into your app bundle, and at the first run just copy them to NSUserDefaults.
Short answer: There are utilities such as iExplorer - https://macroplant.com - that allow "file manager" type access. However...
Long answer: If your app requires users to buy (or get) other software to modify configuration files, the chances of Apple approving it are slim to none.
The appropriate thing to do is to provide a User Interface in your own app which allows the user to modify / update the settings.

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 to access all the files(pdf, doc etc) in iOS?

How can I find out programmatically all the files present in iOS device and list them out to user? Also I need to download the file in my local application database?
How this can be achieved with Objective-C.
You cannot access all files in an iOS device outside the sandbox of the app. But there are other ways you can achieve this. What you can do is:
Access all the files in Gallery using UIImagePickerController.
Access all the user files in network- Dropbox/Google drive/iCloud. They all have separate public APIs that can be downloaded and used to download/upload files in network.
In this way, you can access most of the user files and use the same in your application.
Simple answer : you can't (on a non-jailbroken device).
Each app is launched is in own sandbox and can't interact with the others apps, expect using API provided by Apple for app-communication (ex: extension)
You should look at that Apple guide about App Sandboxing, which is valid for OSX and iOS apps.
The main difference between these two OS, as quoted directly from the doc :
iOS Note: Because it is not for user documents, an OS X container
differs from an iOS container—which, in iOS, is the one and only
location for user documents. In addition, an iOS container contains
the app itself. This is not so in OS X.
You cannot access all the files outside the app sandbox. But, if they are available at some shared location(network), you can use third party libraries to access them. For eg.
1. For iCloud- iOS provides inbuilt framework of UIDocument
2. For dropbox- DropBoxAPI is available
3. For Google drive- there is a separate library to access files in the drive.
Hope this helps :)

accessing iphone file system and copy file

I'd like to know way to access iphones file system and copy files to app's documents programmatically on windows platform. I know there are several programs accoplish this goal here . Also it shouldn't be against the apple licence.
thanks.
As the very article you link to states:
First of all you need have a jailbroken device.
With a device that is not jailbroken, you can not access the filesystem directly.
Any form of jailbreaking breaks Apple's EULA. Thus what you request can't be done.

Resources