Firemonkey iOS access one file from different apps - ios

I am writing multiple apps for iPad. All these apps have some settings in common. I therefore would like to have one app that handles the settings and write them to a file - the respective apps will then retrieve their settings from this single file. Is there a way to access one file from different apps on iOS?

The iOS Keychain may help -> http://shaune.com.au/ios-keychain-sharing-data-between-apps/ though a Google search for FireMonkey APIs for the keychain has proven fruitless. At least it could be a starting point.

Related

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.

Xamarin iOS: What is different between Document Provider and Importing Document

I am new on iOS. In my application, I need to get files on the phone e.g. pdf, words etc in the phone. I know iOS application has their own sandbox to work with, they have no idea of other applications.
I have read some of the extension : Document Provider and a older post importing document through this link : https://mobiforge.com/design-development/importing-exporting-documents-ios
Is there any different between the two setup in my requirement? Sorry this is my first time working on iOS.
Unfortunately, iOS does not allows to share files storage between apps from two different developers.
If you own both apps, you can use App Groups to share data and files between apps. You can read more about App Groups, and how to use the APIs here https://developer.xamarin.com/guides/ios/watch/working-with/app-groups/

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 :)

What is the best way to access iOS filesystem from an app?

I'll be working on a cryptographic app for iPad soon. Along to some other features, I'd like to be able to get documents within the iPad's file system to work with them.
So far, I haven't experimented with that, but I've seen apps such as pdf readers that don't share their files with other apps and can't reach files belonging to other apps. Is it possible -and legal- to reach all the files in the iPad from an app?
Thank you very much!
No. This is not possible unless you Jailbreak your device. All applications are sandboxed and can only access files they are in the their individual sandbox.

Sharing Data Between Apps on an iDevice

Is it possible to share on-disk data between iOS applications, or are they truly sandboxed? In other words if I wanted to make a shared repository of data to be accessed (and/or modified) by one or more of my apps, could it be done?
One of the listings on the iOS features page is "Share Data Among Apps", but is this what I'm looking for, and what are the related APIs?
Googling hasn't turned up much else in this area and I know I can construct a path to just about anywhere in the iDevice directory structure. Would it be against Apple's TOA, leading my apps directly to rejection, or is there hope for such an architecture?
Nothing too easy unless your app is iPad only. Otherwise this thing speaks about URL Prefixing. See "Implementing Custom URL Schemes" http://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/StandardBehaviors/StandardBehaviors.html%23//apple_ref/doc/uid/TP40007072-CH4-SW7.
Here is some info on the iPad only Doc support: http://developer.apple.com/library/ios/#documentation/General/Conceptual/iPadProgrammingGuide/CoreApplication/CoreApplication.html%23//apple_ref/doc/uid/TP40009370-CH6-SW2 see "Document Support on iPad Devices". This DOES NOT work on iPhone/iPod
That looks like marketing speak. The only way to share data locally is to pass it in the URL when launching another app. Otherwise, you need an internet server based solution.
Another thought: can you use TCP locally between apps with the new multitasking support? Apps like Air Sharing are allowed to create listening sockets.
using ios keyChain you can share data between apps.

Resources