Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 as 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!

like image 760
Julian Avatar asked Nov 04 '22 21:11

Julian


1 Answers

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.

like image 135
Amir Naor Avatar answered Nov 09 '22 16:11

Amir Naor