How to get checkin data from facebook account and friends/others data - ios

I am using facebook-ios-sdk-3.11.1 and Xcode 5 and i need to support ios 5,6,7
Old Facebook Doc for checkin
New Facebook Doc for checkin
From this info i have found following code needs to be implemented
[FBRequestConnection startWithGraphPath:#"/me/checkins"
parameters:nil
HTTPMethod:#"GET"
completionHandler:^(
FBRequestConnection *connection,
id result,
NSError *error
) {
/* handle the result */
NSLog(#"result %#",result);
}];
Outuput:
result {
data = (
);
}
I am getting no results even though i have checkin to one place from my facebook account
And how can we get data of friends checkin of user's friends as well

Related

Get Facebook user's page likes iOS

I am making an iOS application where I want to get the list of all the pages that has been liked by the Facebook user. I have already used the permission 'user_likes' using Facebook Graph API. Now I want to display it.
Refer this: https://developers.facebook.com/docs/graph-api/reference/v2.2/object/likes
Kindly help.
I got my answer and this is how I made it happen:
//Page likes
/* make the API call */
[FBRequestConnection startWithGraphPath:#"me/likes?limit=10" parameters:nil
HTTPMethod:#"GET"
completionHandler:^(
FBRequestConnection *connection,
id result,
NSError *error
) {
/* handle the result */
NSLog(#"Likes are:\n\n%#",result);
}];
NSString *fbCountry=[

How to Post image on FB Users wall with the message ?(without using URL for image)

I am trying to post on users wall using ios app by using FB New graph API 3.17.1.But when I post using the graph path me/photos, it will create an bunch of post at one location instead of posting the images as separate story.
I did lot of R&D and found this Post photo on user's wall using Facebook iOS SDK
I used below method to post on user's wall
NSMutableDictionary* postParams = [[NSMutableDictionary alloc] initWithObjectsAndKeys:
#"<Image URL>", #"picture",
#"Facebook SDK for iOS", #"name",
#"build apps.", #"caption",
#"testing for my app.", #"description",
nil];
[FBRequestConnection startWithGraphPath:#"me/feed"
parameters:postParams
HTTPMethod:#"POST"
completionHandler:^(FBRequestConnection *connection, id result,NSError *error)
{
if (error)
{
NSLog(#"Error in uploading the photo %#",error);
}
}];
This method does paste the image on user's wall but for this image has to be uploaded somewhere on internet and we have supply the URL of same.And additionally it makes image visibility very less compared to image posted using me/potos.
[FBRequestConnection startWithGraphPath:#"me/photos" parameters:params
HTTPMethod:#"POST"
completionHandler:^(FBRequestConnection*connection, id result, NSError *error)
{
NSLog(#"Error : %#",error);
NSLog(#"%#",result);
}];
I used above method but it will group the photos into bunch and make the album on the users wall after 3-4 post. And additionally it has limitation of max 25 post per app per day. So this method is negligible.
Please let me know any alternative way, if anyone has used.I would be very thankful.

facebook Like and comment not working in ios

I am working on Facebook like and comment in ios,i am getting the response i.e id of a like object.But it is not showing in Facebook.I am using this code to like a object.
NSDictionary *params = [NSDictionary dictionaryWithObjectsAndKeys:
#"http://samples.ogp.me/226075010839791", #"object",
nil
];
/* make the API call */
[FBRequestConnection startWithGraphPath:#"/me/og.likes"
parameters:params
HTTPMethod:#"POST"
completionHandler:^(
FBRequestConnection *connection,
id result,
NSError *error
) {
/* handle the result */
}];
I am getting one more problem i.e if i clicked on another object of a same user it is giving an error.
message = "(#3501) User is already associated to the object type, website, on a unique action type Like. Original Action ID: 654561277932515";
Please help me.

How to Like in Facebook using FacebookSDK.framework Facebook

I have used FacebookSDK.framework for Facebook integration in my application. I have to like one facebook page from application. I have used following code for liking page.
NSDictionary *params = [NSDictionary dictionaryWithObjectsAndKeys:#"https://www.facebook.com/demoappname"
, #"object",
nil
];
/* make the API call */
[FBRequestConnection startWithGraphPath:#"me/og.likes"
parameters:params
HTTPMethod:#"POST"
completionHandler:^(
FBRequestConnection *connection,
id result,
NSError *error
)
{
NSDictionary *currentResult= [(NSArray *)[result data] objectAtIndex:0];
if(!error)
{
NSLog(#"there is no error");
}
else
{
NSLog(#"There is something wrong at here.");
}
}];
But I am not clear what I have to pass in "object" parameter. Can anybody help to what I am doing wrong at here.
Thanks,
If you read this documentation, it says-
The og.likes action can refer to any open graph object or URL, except for Facebook Pages or Photos.
So, liking a page with Graph API isn't possible.
The only thing you can do- add a Like Button to the page in your app.

facebook ios publishing scores

i'm using facebook ios sdk 3.5, now following the instructions found here https://developers.facebook.com/docs/tutorials/ios-sdk-games/open-graph/ and the code found in the FriendSmasher, i am trying to post a score. However, i'm not seeing any results on my feed.
Thanks
this is my test code for our game:
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys: #"100", #"score", nil];
NSLog(#"Posting new score of 100");
[FBRequestConnection startWithGraphPath:[NSString stringWithFormat:#"%llu/scores", myFBID] parameters:params HTTPMethod:#"POST" completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
if(error){
NSLog(#"AN ERROR HAS OCCURED: %#", error.debugDescription);
}
else
NSLog(#"Score posted");
}];
the request permissions is done using the deprecated function openActiveSessionWithPermissions with email and publish_actions passed
You can check your Activity Log on the desktop for score stories. You'll see stories if you get a high score for example, so you can test that. The fact that a score was posted does not show up in News Feed. The stories that may show up when a score is posted are stories like passing stories (you passed a friend) or high score stories. You can always check these types of stories in your Activity Log.

Resources