Sharing with iOS 6.0 native Facebook integration: “Posted via my app name”?

后端 未结 3 1649
误落风尘
误落风尘 2020-11-29 16:11

I have just integrated facebook into my app via ios 6 but I have an issue when posting on my wall. It simply says \"post via ios app\". I want it to say

3条回答
  •  执念已碎
    2020-11-29 16:57

    I ended up using a custom Facebook framework with the new Facebook SDK 3.1. Facebook Compose View

    The original is here: facebook compose view. I've just fixed a few minor warnings and updated with the new FB SDK 3.1.

    Usage:

    DEFacebookComposeViewControllerCompletionHandler __block completionHandler = ^(DEFacebookComposeViewControllerResult result) {
        [self dismissViewControllerAnimated:YES completion:nil];
        switch (result) {
            case DEFacebookComposeViewControllerResultCancelled:
                NSLog(@"Facebook Result: Cancelled");
                break;
            case DEFacebookComposeViewControllerResultDone:
                NSLog(@"Facebook Result: Sent");
                break;
        }
    };
    DEFacebookComposeViewController * compose = [[DEFacebookComposeViewController alloc] init];
    [compose setInitialText:self.shareText];
    [compose addImage:self.shareImage];
    [compose addURL:self.shareURL];
    [compose setCompletionHandler:completionHandler];
    [self presentViewController:compose animated:YES completion:^{}];
    

    Setup:

    1. Open the project and do a clean build.
    2. Go into the folder $PROJECT_FOLDER\build\Debug-iphonesimulator and drag both the FBComposeView.framework & FBComposeView.bundle into your project.

    Note: Be sure to use the ones in the Debug-iphonesimulator. It is the fat binary. enter image description here

提交回复
热议问题