Getting username and profile picture from Facebook iOS 7

This is the simplest way I’ve found to get the user’s profile picture. [[FBRequest requestForMe] startWithCompletionHandler:^(FBRequestConnection *connection, NSDictionary<FBGraphUser> *FBuser, NSError *error) { if (error) { // Handle error } else { NSString *userName = [FBuser name]; NSString *userImageURL = [NSString stringWithFormat:@”https://graph.facebook.com/%@/picture?type=large”, [FBuser objectID]]; } }]; Other query parameters that can be used are: type: small, … Read more

Error Invalid Scopes: offline_access, publish_stream, when I try to connect with Facebook API

The permissions offline_access and publish_stream are deprecated, thus cannot be requested anymore. publish_stream can be replaced by publish_actions, offline_access is gone. See https://developers.facebook.com/docs/facebook-login/permissions/v2.4#reference https://developers.facebook.com/docs/apps/changelog

Facebook SDK returned an error: Cross-site request forgery validation failed. The “state” param from the URL and session do not match

I found that as long as I enabled PHP sessions before generating the login url, and at the top of the script Facebook eventually redirects to, it works just fine on its own without setting a cookie (as per ale500’s answer). This is using the 5.1 version of the sdk. At the top of both … Read more

Facebook Graph API Comment Doesn’t Return From

Is it possible to get the author of a comment that is posted on a different page? No, that information is not available to you any more. https://developers.facebook.com/docs/graph-api/changelog/version2.11#gapi-90-pages: /page/* — User information will not be included in GET responses for any objects owned by (on) a Page unless the request is made with a Page … Read more

How can I post new comment with Graph API into Social Comments Box?

I can give you half the answer to this question, but still need the other half very much myself. You can post a reply to an existing comment within Social Comments box by finding its post_fbid. To get this you can use FQL such as: https://api.facebook.com/method/fql.query?query=SELECT post_fbid, id FROM comment WHERE object_id IN (SELECT comments_fbid … Read more

How to parse or split URL Address in Java?

Use Android’s Uri class. http://developer.android.com/reference/android/net/Uri.html Uri uri = Uri.parse(“https://graph.facebook.com/me/home?limit=25&since=1374196005”); String protocol = uri.getScheme(); String server = uri.getAuthority(); String path = uri.getPath(); Set<String> args = uri.getQueryParameterNames(); String limit = uri.getQueryParameter(“limit”);