0

I've easily found a way to post a picture to twitter, and email below.. But I still can't find a solution for MMS, all the searches on here say it's not possible but those posts are over a year old.. If anyone knows please help..

TWEET PICTURE

-(IBAction)tweetpicture...{
    TWTweetComposeViewController *twitter = [[TWTweetComposeViewController alloc] init];
    [twitter setInitialText:@""];
    [twitter addImage:tweetimage.image];
    [self presentViewController:twitter animated:YES completion:nil]; 
    [self dismissModalViewControllerAnimated:YES];
}

EMAIL PICTURE

-(IBAction)mailpicture....{
    MFMailComposeViewController *mailComposer = [[MFMailComposeViewController alloc] init];
    [mailComposer setMailComposeDelegate:self];
    if ([MFMailComposeViewController canSendMail]) {
       // [mailComposer setToRecipients:[NSArray arrayWithObjects:@"", nil]];
        [mailComposer setSubject:@""];
        [mailComposer setMessageBody:@"" isHTML:NO];
        [mailComposer setModalTransitionStyle:UIModalTransitionStyleCrossDissolve];
        UIImage *xcode = mailimage.image;
        NSData *xcodeData = UIImagePNGRepresentation(xcode);
        [mailComposer addAttachmentData:xcodeData mimeType:@"image/png" fileName:@""];
        [self presentModalViewController:mailComposer animated:YES]; 
        [mailComposer release]; 

    } else { 
        [mailComposer release]; 
    }
}

MMS PICTURE

-(IBAction)sendviatext...{
    //???
}

FACEBOOK PICTURE

-(IBAction)sendtofacebook...{
    ???
}
El Developer
  • 3,345
  • 1
  • 21
  • 40
Rob Green
  • 5
  • 1

1 Answers1

0

First of you can't send an MMS from code in iOS, only SMS is supported.

And facebook I did something like:

Facebook *facebook = [App instance].facebook;


    if ([facebook isSessionValid]) {

        NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                                       self.capturedImage.image, @"picture",
                                       @"Some nice caption", @"caption",
                                       nil];

        [facebook requestWithMethodName:@"photos.upload"
                               andParams:params
                           andHttpMethod:@"POST"
                             andDelegate:self];
    } else {
        [facebook authorize:[NSArray arrayWithObjects:@"offline_access", nil]];
    }
rckoenes
  • 69,092
  • 8
  • 134
  • 166
  • damn that sucks... well what about instagram? NSURL *instagramURL = [NSURL URLWithString:@"instagram://location?id=1"]; if ([[UIApplication sharedApplication] canOpenURL:instagramURL]) { [[UIApplication sharedApplication] openURL:instagramURL]; } – Rob Green Jul 03 '12 at 07:45