iphone - 如何在社交网站上分享我的文字(如表情符号)?

标签 iphone social-networking share

我不会在 tumbler/twitter/Facebook/其他社交网站上分享我的文本(字符串)。

我不知道如何分享。任何人都可以有想法或示例代码吗?

请帮助我。

提前致谢。

最佳答案

如果您想分享表情符号键盘,请在此处查看 http://www.easyapns.com/blog还有用于共享的社交框架。

-(void)openFBController
{


SLComposeViewController *fbController=[SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];

if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook] == NO) {
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil message:@"This device is not able to Share Facebook or Facebook account is not configured." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
    [alert show];

}

if([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook])
{
    SLComposeViewControllerCompletionHandler __block completionHandler=^(SLComposeViewControllerResult result){

        [fbController dismissViewControllerAnimated:YES completion:nil];

        switch(result){
            case SLComposeViewControllerResultCancelled:
            default:
            {
                NSLog(@"Cancelled.....");

            }
                break;
            case SLComposeViewControllerResultDone:
            {
                NSLog(@"Posted....");

                UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"PeekAboo!" message:@"Post Successfully." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
                [alert show];
            }
                break;
        }};

    [fbController addImage:[UIImage imageNamed:@"@"give ur imagename""]];
    [fbController setInitialText:@"give ur text"];

    [fbController addURL:[NSURL URLWithString:@"give ur url"]];
    [fbController setCompletionHandler:completionHandler];
    [self presentViewController:fbController animated:YES completion:nil];
}


//Note:It doesn't show the old albums list to select in fbController in my account,
//I don't know if thats the case with other people as well.
//After I created and transfered the data from FB to device FB.
//All the albums created afterwards were shown in the list.

}


- (void)canTweetStatus {


SLComposeViewController *TweetStatusController=[SLComposeViewController composeViewControllerForServiceType:SLServiceTypeTwitter];

if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter] == NO) {
    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:nil message:@"This device is not able to Share Twitter or Twitter account is not configured." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
    [alert show];

}


if([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter])
{
    SLComposeViewControllerCompletionHandler __block completionHandler=^(SLComposeViewControllerResult result){

        [TweetStatusController dismissViewControllerAnimated:YES completion:nil];

        switch(result){
            case SLComposeViewControllerResultCancelled:
            default:
            {
                NSLog(@"Cancelled.....");

            }
                break;
            case SLComposeViewControllerResultDone:
            {
                NSLog(@"Posted....");
                UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"PeekAboo!" message:@"Post Successfully." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
                [alert show];
            }
                break;
        }};

    [TweetStatusController addImage:[UIImage imageNamed:@"icon.png"]];
    [TweetStatusController setInitialText:@"give ur text"];
    [TweetStatusController addURL:@"give ur url"]];
    [TweetStatusController setCompletionHandler:completionHandler];
    [self presentViewController:TweetStatusController animated:YES completion:nil];
}


}

关于iphone - 如何在社交网站上分享我的文字(如表情符号)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11299067/

相关文章:

iphone - 您如何在启动时播放音乐?

iphone - 如何从 NSFetchedResultsControllerDelegate 实现延迟/批量 TableView 更新?

ios - iOS 推送通知中的 header (粗体)和正文

iphone - 如何通过代码更改应用程序首选项设置?

algorithm - 使用矩阵补全算法进行​​图恢复

php - 如何处理事件流中已删除的照片

r - 在 R 中,如何根据多个属性分数从 igraph 对象生成子图?

linux - 为什么我的 rpi 上的共享/in samba 不再起作用?

推特 "View Summary"按钮

ios - Objective-c - 附加 UIImage 进行分享