Question

I have an iPhone app that is used for taking photos. I just finished adding the Facebook sharing functionality to this app.

I went through this entire page here: https://developers.facebook.com/docs/ios/open-graph

I followed all of the instructions, and copied and pasted the code into xcode. The only thing I didn't do was the one part at the very bottom of the page called "Deep Linking", but that is not important right now.

After doing all of this, my app can successfully share an image to facebook. However, it is not being shared the way I need it to.

When I go to my facebook page to see the share, you would never even know it's there. I have to scroll almost half way down the page, and then it's in the bottom left corner.

Here is a screenshot showing where the share is located on my facebook page when viewed on a Desktop computer:

enter image description here

And here is how the share looks when using the Facebook App for the iPhone (I blacked out my name):

enter image description here

These both look terrible. Here are 2 examples of what I want to accomplish.

Here is how a photo from this app called "Frontback" looks when I share it to my page and view on a Desktop computer:

enter image description here

And it looks the same on the Facebook App for the iPhone as well.

The only difference I can tell is that the URL for my shares has "/activity/" in it, where as the Frontback app shares have "photo.php" in their Facebook URL's.

I can't figure out how to get my app's shares to look like the shares from the Frontback app.

Any help is greatly appreciated thank you.

Était-ce utile?

La solution

The posts that you created seems meaningful to me. An open-graph feed is always beautiful and more meaningful than the normal feed.

What Frontback post you are seeing is simple photo upload, that's not a feed. I mean it all depends on your requirement, what exactly your app will want to do.

  • If you just want to show some photos via your app like Frontback, you can avoid open graph and publish photos using the API \POST /photos.

  • But if you want to give a link that could redirect the user to the app you should use what you are using right now.

Another thing, when you said-

When I go to my facebook page to see the share, you would never even know it's there. I have to scroll almost half way down the page, and then it's in the bottom left corner.

That's the beauty of open-graph, it clubs all the activities of an app in your timeline, not unnecessarily making status updates and flooding your timeline. The stories appear on top in your/your friends wall and the ticker. You can also see the actual story by clicking on the time in the story of your activity log-

(activity log)

enter image description here

(actual story)

enter image description here

Autres conseils

- (void)requestPermissionAndPost {
    [FBSession.activeSession requestNewPublishPermissions:[NSArray arrayWithObjects:@"publish_actions", @"publish_checkins",nil]
                                          defaultAudience:FBSessionDefaultAudienceEveryone
                                        completionHandler:^(FBSession *session, NSError *error) {
                                            if (!error) {
                                                // Now have the permission
                                                [self postOpenGraphAction];
                                            } else {
                                                // Facebook SDK * error handling *
                                                // if the operation is not user cancelled
                                                if (error.fberrorCategory != FBErrorCategoryUserCancelled) {
                                                    [self presentAlertForError:error];
                                                }
                                            }
                                        }];
}
- (void)postOpenGraphAction
{
    FBRequestConnection *newConnection = [[FBRequestConnection alloc] init];
    FBRequestHandler handler =
    ^(FBRequestConnection *connection, id result, NSError *error) {
        // output the results of the request
        [self requestCompleted:connection forFbID:@"me" result:result error:error];
    };

    UIImage *img = imageView.image;
    NSString *message = [NSString stringWithFormat:@"%@ %@ #DealsHype",msg.text,hashtagFromStore];
    FBRequest *request=[[FBRequest alloc] initWithSession:FBSession.activeSession graphPath:@"me/photos" parameters:[NSDictionary dictionaryWithObjectsAndKeys:UIImageJPEGRepresentation(img, 0.7),@"source",message,@"message",@"{'value':'EVERYONE'}",@"privacy", nil] HTTPMethod:@"POST"];


    [newConnection addRequest:request completionHandler:handler];
    [self.requestConnection cancel];
     self.requestConnection = newConnection;
    [newConnection start];
}

this is the good to upload image with some message .. if you want to upload a big image like Frontback

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top