开发者

Publishing Check-in via Facebook IOS SDK

I'm trying to publish a check-in on a users wall. I don't need to get the longitude and latitude of the users device. But rather have this static a开发者_开发知识库s well as the place the user will check-in too. Basically a "check-in" button that already has static coordinates and a message.

I got the demo app up and running but can't seem to find any step by step tutorials on this particular topic. Is there any link around or a sample project you can point me to?

Thanks!


First, you need to have a place id. Assuming you have that you can use the Facebook Graph API to make a feed post to check-in the user.

You can do something like this (using Facebook iOS SDK 3.0):

[FBRequestConnection startForPostStatusUpdate:@"Awesome place!"
                                        place:@"110506962309835"
                                         tags:nil
                            completionHandler:^(FBRequestConnection *connection,
                                                id result,
                                                NSError *error) {
        //verify result
                            }
     ];

Or:

[FBRequestConnection startWithGraphPath:@"me/feed"
                             parameters:@{@"place":@"110506962309835"}
                             HTTPMethod:@"POST"
                      completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
        //verify result
    }];

You will need to ask the user for publish_stream permission before making this call.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜