Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New created Facebook Apps are not working (com.facebook.sdk error 5) #62

Open
gugmaster opened this issue Aug 21, 2014 · 2 comments
Open

Comments

@gugmaster
Copy link

New created Facebook Apps (created after 7th August 2014) are not working anymore because they use Facebook API 2.1 and this doesn't allow fql anymore. If you use a newly created Facebook app you will get the following error:

2014-08-21 10:54:06.505 GrabKitDemo[2280:429755] error ! Error Domain=com.grabKit.Facebook.albums Code=400 "result has a bad format" UserInfo=0x175a3be0 {originalError=Error Domain=com.facebook.sdk Code=5 "The operation couldn’t be completed. (com.facebook.sdk error 5.)" UserInfo=0x175c1e90 {com.facebook.sdk:HTTPStatusCode=400, com.facebook.sdk:ParsedJSONResponseKey={
body = {
error = {
code = 12;
message = "(#12) fql is deprecated for versions v2.1 and higher";
type = OAuthException;
};
};
code = 400;
headers = (
{
name = Expires;
value = "Sat, 01 Jan 2000 00:00:00 GMT";
},
{
name = "Cache-Control";
value = "no-store";
},
{
name = "Access-Control-Allow-Origin";
value = "";
},
{
name = Pragma;
value = "no-cache";
},
{
name = "Content-Type";
value = "text/javascript; charset=UTF-8";
},
{
name = "Facebook-API-Version";
value = "v2.1";
},
{
name = "WWW-Authenticate";
value = "OAuth "Facebook Platform" "invalid_request" "(#12) fql is deprecated for versions v2.1 and higher"";
}
);
}, com.facebook.sdk:ErrorSessionKey=<FBSession: 0x176d6e60, state: FBSessionStateOpen, loginHandler: 0x176d6f10, appID: 814536998589993, urlSchemeSuffix: , tokenCachingStrategy:<FBSessionTokenCachingStrategy: 0x175d1e70>, expirationDate: 2014-10-19 11:50:42 +0000, refreshDate: 2014-08-21 08:54:05 +0000, attemptedRefreshDate: 0000-12-30 00:00:00 +0000, permissions:(
"user_photos",
"user_photo_video_tags"
)>}, NSLocalizedDescription=result has a bad format}
2014-08-21 10:54:06.744 GrabKitDemo[2280:429755] error ! Error Domain=com.grabKit.Facebook.albums Code=400 "result has a bad format" UserInfo=0x175a6ee0 {originalError=Error Domain=com.facebook.sdk Code=5 "The operation couldn’t be completed. (com.facebook.sdk error 5.)" UserInfo=0x176f6190 {com.facebook.sdk:HTTPStatusCode=400, com.facebook.sdk:ParsedJSONResponseKey={
body = {
error = {
code = 12;
message = "(#12) fql is deprecated for versions v2.1 and higher";
type = OAuthException;
};
};
code = 400;
headers = (
{
name = Expires;
value = "Sat, 01 Jan 2000 00:00:00 GMT";
},
{
name = "Cache-Control";
value = "no-store";
},
{
name = "Access-Control-Allow-Origin";
value = "
";
},
{
name = Pragma;
value = "no-cache";
},
{
name = "Content-Type";
value = "text/javascript; charset=UTF-8";
},
{
name = "Facebook-API-Version";
value = "v2.1";
},
{
name = "WWW-Authenticate";
value = "OAuth "Facebook Platform" "invalid_request" "(#12) fql is deprecated for versions v2.1 and higher"";
}
);
}, com.facebook.sdk:ErrorSessionKey=<FBSession: 0x176d6e60, state: FBSessionStateOpen, loginHandler: 0x176d6f10, appID: 814536998589993, urlSchemeSuffix: , tokenCachingStrategy:<FBSessionTokenCachingStrategy: 0x175d1e70>, expirationDate: 2014-10-19 11:50:42 +0000, refreshDate: 2014-08-21 08:54:05 +0000, attemptedRefreshDate: 0000-12-30 00:00:00 +0000, permissions:(
"user_photos",
"user_photo_video_tags"
)>}, NSLocalizedDescription=result has a bad format}

Facebook API 2.0 will deprecate on August 7, 2016

Maybe I have time to create support for this. A simple workaround for me is to use an older sample Facebook app that I created some time ago and modify for this purpose.

@Pratik-Somaiya
Copy link

Replace these two lines for facebook in GRKFacebookGrabber.m

in function : -(void) albumsOfCurrentUserAtPageIndex:(NSUInteger)pageIndex
withNumberOfAlbumsPerPage:(NSUInteger)numberOfAlbumsPerPage
andCompleteBlock:(GRKServiceGrabberCompleteBlock)completeBlock
andErrorBlock:(GRKErrorBlock)errorBlock;
// NSString * graphPathFQL = @"fql";
NSString * graphPathFQL = @"me/albums";

// NSMutableDictionary *paramsFQL = [NSMutableDictionary dictionaryWithObjectsAndKeys:
// @"SELECT '' FROM photo_tag WHERE subject=me()", @"q",
// nil];
NSMutableDictionary *paramsFQL = [NSMutableDictionary dictionary];

@albertoramonj
Copy link

Did the trick!. Thanks @psomaiya17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants