从iPhone附加MMS / Facebook中的图像。

时间:2012-07-03 05:49:18

标签: iphone xcode image mms

我很容易找到一种方法将图片发布到Twitter,并在下面发送电子邮件.. 但我仍然无法找到MMS的解决方案,这里的所有搜索都说不可能,但这些帖子已经超过一年了..如果有人知道请帮助..

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];
}

电子邮件图片

-(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]; 
    }
}

彩信图片

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

FACEBOOK PICTURE

-(IBAction)sendtofacebook...{
    ???
}

1 个答案:

答案 0 :(得分:0)

首先,您无法从iOS中的代码发送彩信,只支持短信。

和facebook我做了类似的事情:

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]];
    }