简体   繁体   English

如何在IOS6中的本地Facebook共享上更改“通过iOS”

[英]How to Change “via iOS” on native Facebook sharing in IOS6

Hi i am using following code to share message using IOS6 native lib 嗨,我正在使用以下代码使用IOS6本机库共享消息

if([SLComposeViewController isAvailableForServiceType:SLServiceTypeFacebook])
    {
        SLComposeViewController *mySLComposerSheet = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];
        [mySLComposerSheet setInitialText:@"Good morning all"];
        //[mySLComposerSheet addImage:[UIImage imageNamed:@"img1.png"]];
        [mySLComposerSheet addURL:[NSURL URLWithString:@"http://www.google.com/"]];
        [self.superViewController presentViewController:mySLComposerSheet animated:YES completion:nil];
        [mySLComposerSheet setCompletionHandler:^(SLComposeViewControllerResult result) {
            NSString *output = @"";
            switch (result) {
                case SLComposeViewControllerResultCancelled:
                    output = @"ACtionCancelled";
                    break;
                case SLComposeViewControllerResultDone:
                    output = @"Post Successfull";
                    break;
                default:
                    break;
            }
            UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Facebook Message" message:output delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil];
            [alert show];
        }];
    }

it is successfully posted But in my facebook it is showing via IOS but i want to display my application name. 它已成功发布,但是在我的Facebook中,它是通过IOS显示的,但是我想显示我的应用程序名称。 I followed all steps when i am creating app id on facebook developer zone 在Facebook开发人员区域上创建应用程序ID时,我遵循了所有步骤

How to change IOS to my application name? 如何将IOS更改为我的应用程序名称? 在此处输入图片说明

I also tried this code http://www.developers-life.com/facebook-compose-view.html 我也尝试了此代码http://www.developers-life.com/facebook-compose-view.html

When using SLComposeViewController you cannot change the "via" name, it will always show "iOS" as the source. 使用SLComposeViewController ,无法更改“ via”名称,它将始终显示“ iOS”作为源。

You are required to use the Facebook iOS SDK and set up your own custom compose view instead of using the native SLComposeViewController. 您需要使用Facebook iOS SDK并设置自己的自定义撰写视图,而不是使用本机SLComposeViewController。

UPDATE UPDATE

Facebook's 3.5+ SDK offers a number of great solutions, such as the Share Dialog , which uses the native Facebook and open graph. Facebook的3.5+ SDK提供了许多出色的解决方案,例如使用本地Facebook和开放图的“ 共享对话框”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM