How can I transfer files from one application to another in the same iOS device?
UIDocumentInteractionController
is your friend.
Basically it works like this:
- App 1 registers as being able to handle files of type XYZ
- App 2 implements
UIDocumentInteractionController
and will give users the options to "send the file to App1" (I believe this has to be user activated) - App 1 implements
-(BOOL)application:openURL:sourceApplication:annotation:
and deals with the transferred file which will be saved in yourDocuments/Inbox
directory. From there you can copy the file elsewhere and then manipulated it, making sure you clean up by getting rid of the original one saved on the Inbox folder.
Class reference available here
Document interaction programming guide available here
How to transfer data from one app to another app in same ios device?
There's an example of UIDocumentInteractionController
to share files on iOS. iOS is designed to prevent apps from sharing data directly. So, UIDocumentInteractionController
provided by Apple is the thing you should use to mimic something similar to direct sharing.
-(void)shareOnInstagram:(UIImage*)image {
NSString *jpgPath = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents/image.igo"];
[[NSFileManager defaultManager] removeItemAtPath:jpgPath error:nil];
[UIImageJPEGRepresentation(image, 0.6) writeToFile:jpgPath atomically:YES];
NSURL *igImageHookFile = [NSURL fileURLWithPath:jpgPath];
self.dic = [self setupControllerWithURL:igImageHookFile usingDelegate:self];
self.dic.UTI = @"com.instagram.exclusivegram";
[self.dic presentOpenInMenuFromRect:CGRectMake(0, 0, 320, [UIScreen mainScreen].bounds.size.height) inView:self.view animated:YES];
}
- (UIDocumentInteractionController *) setupControllerWithURL: (NSURL*) fileURL usingDelegate: (id <UIDocumentInteractionControllerDelegate>) interactionDelegate {
UIDocumentInteractionController *interactionController = [UIDocumentInteractionController interactionControllerWithURL: fileURL];
interactionController.delegate = interactionDelegate;
return interactionController;
}
See https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIDocumentInteractionController_class/
How to transfer data from one app to another app from different iOS devices which have same WiFi network in swift?
I used MultipeerConnectivity framework and it works great
Transfer file from one ios device to another using wifi and 3G network?
To do transfers between two devices without a mediator, at least one device must run some kind of a server (like http://code.google.com/p/ios-ftp-server/, for the client see SimpleFTPSample). But then you also need to discover ip addresses (maybe with ZeroConf). A lot of hassel, if possible at all; both clients must be in the same network and therefor won't work on 3G.
If you are ok with a mediator, things get much simpler. I have created an Open Souce App called cross copy which uses http REST commands to transfer files between devices (and hence also provides a web app for the desktop).
Obviously there are other nice mediator-based solutions: DropBox, Bump, Hoccer, etc
Share Files between Apps on the same iPad (Without iCloud)
This link at github may be useful... Looks like someone has already made a file manager, using these elements you may be able to do what you are looking for. But as far as I know, your app is extremely sandboxed and does not really interact with other apps/the file system very much at all (Apple is very limiting that way)
EDIT
this post seems to have the explanations of local data sharing methods you were looking for. None of the methods in this post requires any connectivity, just a device and 2 apps :) Good luck!
Access files of one Application from other application in ios
Read Apple Doc File System Basics
How to share files with all other devices from my iOS device through application?
iBeacon is not for file sharing, for more information check this link
And about file sharing between Android and iOS via Bluetooth it has asked before here
But you can write an App that enables file sharing between iOS devices quite simple. Check MultiPeer Connectivity Framework
Also there are new technologies but I don't have enough information about them.
Related Topics
Using Convertpoint to Get the Relative Position Inside a Parent Uiview
Logging Method Signature Using Swift
Uiscrollview Adjusts Contentoffset When Contentsize Changes
Number of Threads Created by Gcd
iOS Avplayer Trigger Streaming Is Out of Buffer
How to Custom Modal View Controller Presenting Animation
Does iOS Provide Built in Text to Speech Support or Any Class Like Nsspeechrecognizer
Disable the Uitableview Highlighting But Allow the Selection of Individual Cells
Popping and Pushing View Controllers in Same Action
Wait for Async Task to Finish Completion Block Before Returning in App Delegate
Afnetworking 2.0 Track File Upload Progress
Why Tesseract Ocr Library (Ios) Cannot Recognize Text at All
Fbsession: an Attempt Was Made Reauthorize Permissions on an Unopened Session
Uiwebview VS Wkwebview to Load Local HTML
Custom Tabbar Layout for Uitabbarviewcontroller