简体   繁体   中英

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

Hi i am using following code to share message using IOS6 native lib

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. I followed all steps when i am creating app id on facebook developer zone

How to change IOS to my application name? 在此处输入图片说明

I also tried this code 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.

You are required to use the Facebook iOS SDK and set up your own custom compose view instead of using the native SLComposeViewController.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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