简体   繁体   中英

show app name on facebook share iPhone

I am using facebook.framework i want to share image using native facebook Dialog of iOS 6.0

I can share image but i want to show my app name.... like currently it showing via ios.... I6+ +65 want to show app name..Like via xyz... I am using below code.....

        - (IBAction)publishButtonAction:(id)sender {
// Try and present the iOS Share Sheet
[FBDialogs
 presentOSIntegratedShareDialogModallyFrom:self
 initialText:@"" image:[UIImage imageNamed:@"iossdk_logo.png"]
 url:[NSURL URLWithString:@"https://developers.facebook.com/ios"]
 handler:^(FBOSIntegratedShareDialogResult result, NSError *error) {
     NSString *alertText = @"";
     if ([[error userInfo][FBErrorDialogReasonKey]
          isEqualToString:FBErrorDialogNotSupported]) {
         alertText = @"iOS Share Sheet not supported.";
     } else if (error) {
         alertText = [NSString stringWithFormat:
                      @"error: domain = %@, code = %d",
                      error.domain, error.code];
     } else if (result == FBNativeDialogResultSucceeded) {
         alertText = @"Posted successfully.";
     }
     if (![alertText isEqualToString:@""]) {
         // Show the result in an alert
         [[[UIAlertView alloc] initWithTitle:@"Result"
                                     message:alertText
                                    delegate:self
                           cancelButtonTitle:@"OK!"
                           otherButtonTitles:nil]
          show];
     }
}];

}

Unfortunately, you can't show your App Name if you want to use Facebook.framework and the iOS 6 default share dialog.
The only way to achieve this is to register an app on Facebook Developers and handle every connection/request using their iOS SDK .

Facebook.framework is the most straightforward way to deal with Facebook APIs but you have to renounce to your app name. Otherwise, you can take the harder way and build your app from scratch so you'll be able to show your app name. More info here: Facebook Share Dialog .

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