ephilip
ephilip

Reputation: 1035

Facebook Graph API call not working in iOS application

So I'm trying to write an iPhone application that allows a user to "Check-in" to a store using the Graph API method; something like

NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
app_id, @"app_id",
@"111664535537155", @"place",
@"I just Checked Into A Retail Store", @"message", nil];

[appDelegate.facebook requestWithGraphPath:@"me/checkins" andParams: params     andHttpMethod:@"POST" andDelegate:self];

but I'm having no luck. I know I've setup the rest of the Facebook Connect stuff fine, since my dialog calls such as

NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
                               app_id, @"app_id",
                               @"Facebook Dialogs", @"name",
                               @"Test Post", @"caption",
                               @"Check out my Test Post", @"message",
                               nil];


[appDelegate.facebook dialog:@"feed" andParams:params andDelegate:self];

works fine. According to This tutorial Facebook Connect supports Graph API calls, and the authentication should be enough.

Am I missing something? What should I try doing to fix this? I've taken a look at the other related questions on Stack Overflow, but none of the solutions seems to solve my problem.

Thanks

Upvotes: 1

Views: 1277

Answers (2)

C Abernathy
C Abernathy

Reputation: 5513

You also need to pass in the "coordinates" parameter. See https://developers.facebook.com/docs/reference/api/user/ and look for checkins

Upvotes: 1

bkaid
bkaid

Reputation: 52083

Did you prompt the user for "publish_checkins" extended permission?

Upvotes: 0

Related Questions