0

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

推文图片

-(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...{
    //???
}

脸书图片

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

1 回答 1

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]];
    }
于 2012-07-03T07:15:38.790 回答