0

I am trying to put a movie into the body of a text message from inside my app. I am using MFMessageComposeViewController to bring up the message view. I can put text into the body but I would like to put a movie. like Apple does when you select a movie in the photo library. I have the path and name for the movie I just need to convert the url to a string so I can have the body = to it. here is my code

NSString *audioName = [pictureDictionary2 objectForKey:@"photoVideokey"];
    NSArray *pathsa = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *documentsDirectorya = [pathsa objectAtIndex:0];
    //Get a full path to the image in the documents directory.
    NSString *fullPatha = [documentsDirectorya stringByAppendingPathComponent:audioName];
    self.sharingImage = [NSURL fileURLWithPath:fullPatha];
    NSURL *url1 = [NSURL fileURLWithPath:fullPatha];
    NSData *videoData = [[NSData alloc] initWithContentsOfURL:url1];

//I know this isn't right and I have tried several things but can't seem to solve it.
    NSString* theString = [NSURL fileURLWithPath:fullPatha];



    MFMessageComposeViewController *controller = [[MFMessageComposeViewController alloc] init];
    if([MFMessageComposeViewController canSendText])
    {
        controller.body = theString;

        controller.messageComposeDelegate = self;
        if (controller) [self presentViewController:controller animated:YES completion:NULL];
    }

thanks for any help anyone can give.

user1114881
  • 731
  • 1
  • 12
  • 25

1 Answers1

0

I think you can't because I think Apple doesn't gives such permission to a custom app to add data to a messagecomposer but you can do this with mailcomposer.

Exploring
  • 925
  • 6
  • 18