I wish to open a file (stored locally in my app) with another app.
Currently, I am using openURL (there is a dedicated url scheme), and it works fine if I use a file hosted on the internet, but I would like to use a local file so: a) it works offline b) a lot of the time my users are either out of cell zone coverage, or roaming internationally
What I have tried so far: I have not had any luck telling openURL to use a local file, I have tried a few approaches but they are all something like this
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"test" ofType:@"ext"];
NSURL *fileURL = [NSURL fileURLWithPath:filePath];
[[UIApplication sharedApplication] openURL:fileURL];
also
NSURL *fileURL = [[NSBundle mainBundle] URLForResource: @"test" withExtension:@"ext"];
[[UIApplication sharedApplication] openURL:fileURL];
also manually using strings with different variations of localhost/ and file:// and var/mobile etc paths
nothing works (for me anyway)
So, I looked around SO and came across UIDocumentInteractionController
I am able to use UIDocumentInteractionController to let the user open my local file with the other app - however it always present multiple options of other apps to use and for example, one of the other apps can be 'Dropbox'.
I do not want to let the user download (or upload technically) a copy of my file for their use in other ways. It contains data that I would prefer not to make so readily available.
When the file is opened by my intended app (not made by me btw) it does not allow any kind of saving or access to raw data.
I realize that by including the file in my app anyone who is serious about obtaining it will be able to, I just don't want to flash a big menu saying 'Here it is if you want your own copy to make derivative work from'
Ideally, I could use openURL but I think it is because of the 'sandbox' that the other app doesn't respond - in Android I use mode_world_readable to declare the file as readable by other apps (therefore placing it outside the sandbox, and it doesn't allow other apps to write to it, just read) - is there anyway of doing the same with iOS?
Otherwise, if I could force UIDocumentInteractionController to use a specific app and not present the menu - that would be fine too.
Similar question asked a while ago
Sorry about the long read, any help is appreciated.
Edit: I just received an answer from Apple Tech support and they told me that this is currently impossible (just after iOS 6 released)