Varun Mehta
Varun Mehta

Reputation: 1753

How to export file from your app to others mobile app?

I want to put sharing feature in my application so that i can share file created in my app to app on others mobile. Please if anybody has any idea or code let me know....:-)

Upvotes: 0

Views: 113

Answers (2)

Srikar Appalaraju
Srikar Appalaraju

Reputation: 73588

Some of the ways I can think of -

  1. Send your file as mail attachement as @Akshay points out.
  2. Use Gamekit framework in iOS to transfer data between iOS devices without internet.
  3. You could use Bluetooth, but essentially I think GameKit uses that. so you might as well go with gamekit instead of (re)defining your own protocol...

Happy coding...

Upvotes: 2

Akshay
Akshay

Reputation: 5765

You can compose a new email using MFMailComposeViewController and attach the file.

MFMailComposeViewController* controller = [[MFMailComposeViewController alloc] init];

    controller.mailComposeDelegate = self;

    [controller addAttachmentData:[NSData dataWithContentsOfFile:path] mimeType:mimeType fileName:[path lastPathComponent]]; //path is the path to your file

    [self presentModalViewController:controller animated:YES];
    [controller release];

For iOS 5.0 or later, you could use iCloud.

HTH,

Akshay

Upvotes: 0

Related Questions