I'm trying to send app invites to friends which do not have iOS app installed using Facebook.
In Facebook documentation it says that /me/invitable_friends path is used for it. Problem is that response data is always empty without any error. I've granted user_friends permission.
I have created Canvas page but in Settings I've set Canvas URL to http://localhost.com/facebook/. Thing is that this game needs to be iOS only without Canvas. Is it possible to achieve sending app invites without Canvas?
Here is my request:
[FBRequestConnection startWithGraphPath:#"/me/invitable_friends"
parameters:nil
HTTPMethod:#"GET"
completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
NSLog(#"Resulr: %#", result);
NSLog(#"Error: %#", error);
}];
This is the output:
Result: {
data = (
); } Error: (null)
Old question but still unresolved ? For me, that answer fixed the issue : https://stackoverflow.com/a/28596530/2452521
Related
Hi I am working in xcode 6.4.
I am trying to create an application which integrate with Facebook.I want to fetch the event details of the user. That is, I want event_name, place, time, number of friends going and their details. I found many answers for this problem here and I tried them. But I couldn't build the app with that much of information. Please give me a detailed solution for the same.
[FBRequestConnection startWithGraphPath:#"me/events"
parameters:#{#"fields":cover,name,start_time,end_time"} HTTPMethod:#"GET"
completionHandler:^(FBRequestConnection *connection, id result, NSError *error)
{
if (!error)
{
NSLog(#"event_name%#",[result objectForKey:#"name"]);
NSLog(#"start_time%#",[result objectForKey:#"start_time"]);
NSLog(#"end_time%#",[result objectForKey:#"end_time"]);}
else
{
NSLog(#"%#", [errolocalizedDescription]);
}
}];
I'm trying to fetch Facebook posts for a public page using the Facebook SDK for iOS. I can't seem to figure out how to get and then use the access token I need to make this request. Let's say it's the New York Times page. This shouldn't require any permissions, so I should be able to use the App Access Token...but again, I can't figure out how to get & use that.
The code I am using looks like this:
[FBRequestConnection startWithGraphPath:#"/nytimes/posts" completionHandler:^(FBRequestConnection *connection, id result, NSError *error)
{
NSLog(#"DATA: %#", [result data]);
NSLog(#"ERROR: %#", error);
}];
I keep receiving an error saying that an access token is required.
Please help!
It means it asking you a permission to access the public post in view did load method put one line code like (readPermissions = #[#"public_profile", #"email",#"user_friends",#"user_likes",#"user_groups"];)
, for more details see this https://developers.facebook.com/docs/facebook-login/permissions/v2.2.
i want to get all friend list from Facebook . i am use Facebook version 3.14 SDK . but i got always null data after call Facebook API.
/* make the API call */
[FBRequestConnection startWithGraphPath:#"/me/taggable_friends"
parameters:nil
HTTPMethod:#"GET"
completionHandler:^(
FBRequestConnection *connection,
id result,
NSError *error
) {
/* handle the result */
}];
And Its Permission also give user_friends
I am also put my apps in Facebook Review but i have got alert as below.
I'm trying to use the Facebook SDK 3.2 in my iOS app to get the users facebook news feed. I've successfully got the native facebook login to work and requested the extended read permission.
I guess looking at the documentation I need to use the FBRequest and FBRequestConnection classes but I can't find any examples of this sort of thing on the facebook developer site, at least not enough for me to confidently go on. Must say the tutorials on the facebook dev site aren't as good as they used to be!
Could someone help me out with an example?
EDIT : FQL is deprecated (since 2.0), we should now use the Graph API. The link provided at the bottom of this post shows valuable information, see the red Alert at the top of the screen once you get there.
You will need the "read_stream" permission.
Then use FQL to get the news feed.
I'm doing it like this:
NSString *fqlQuery = #"SELECT post_id, created_time, type, attachment FROM stream WHERE filter_key in (SELECT filter_key FROM stream_filter WHERE uid=me() AND type='newsfeed')AND is_hidden = 0 LIMIT 300";
// Make the API request that uses FQL
[FBRequestConnection startWithGraphPath:#"/fql"
parameters:[NSDictionary dictionaryWithObjectsAndKeys: fqlQuery, #"q", nil]
HTTPMethod:#"GET"
completionHandler:^(FBRequestConnection *connection,
id result,
NSError *error)
{
if (error)
NSLog(#"Error: %#", [error localizedDescription]);
else
NSLog(#"Result: %#", result);
}];
For more infomation look here: http://developers.facebook.com/docs/reference/fql/stream
I'm using the Facebook SDK for iPhone. I need to be able to retrieve the authenticated users details AND profile picture in one request.
In the beta's of the SDK I used to be able to do this using the following code below, but it is now only returning the user id and the picture url.
[FBRequestConnection startWithGraphPath:#"me" parameters:[NSDictionary dictionaryWithObject:#"picture" forKey:#"fields"] HTTPMethod:#"GET" completionHandler:^(FBRequestConnection *connection, id result, NSError *error)...
Is there a way to do this in one request? Many thanks for any advice.
[EDIT] I should also probably mention that I require the URL string to the image directly as I am not using Facebook's new FBProfilePictureView class.
Brain fart! I should have included all the properties I wanted returned in the parameters dictionary. I was under the impression from Facebook's doc that you only had to include the picture property if you wanted it returned WITH the user information. The correct request is as below:
[FBRequestConnection startWithGraphPath:#"me"
parameters:[NSDictionary dictionaryWithObject:#"picture,id,birthday,email,first_name,last_name,gender,username" forKey:#"fields"]
HTTPMethod:#"GET"
completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
}];
Here is an updated solution.
var basicUserData = ["fields": "picture,id,birthday,email,first_name,last_name,gender"]
FBRequestConnection.startWithGraphPath("/me",
parameters: basicUserData,
HTTPMethod: "GET") {
(connection:FBRequestConnection!, result, error) -> Void in
if error != nil {
print(error!)
} else {
print(result!)
}
}
The Parse team recommended getting FB profile picture by accessing the https://graph.facebook.com/(facebookId)/picture?type=large Make sure to replace with the user's Facebook Id. Here is the discussion
Notes:
username field is deprecated after FacebookSDK v2
"/me" is the correct endpoint not "me"
This gist shows many other interactions with the Facebook Graph