I am working on facebook page like without facebook like button. In my application.
i am using following code to like page from my application.
Following is page url for which i want to add like in Facebook.
NSString *likePage=@"https://www.facebook.com/pages/Shaktimantelecom/265306070277816?ref=hl"; // here you page url
Following is my FaceBookRequestConnection
class to like page from my application.
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
likePage, @"object",[[NSUserDefaults standardUserDefaults] valueForKey:@"token"],@"access_token",
nil];
[FBRequestConnection startWithGraphPath:@"/me/og.likes" parameters:params HTTPMethod:@"POST" completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
UIAlertView *alert=[[UIAlertView alloc] initWithTitle:nil message:[NSString stringWithFormat:@"liked with id %@",[result valueForKey:@"id"]] delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil];
[alert show];
NSLog(@"result is %@",result);
}];
When i use the above code it gives me error as "The operation couldn't be completed (com.facebook.sdk error 5)"
.
Please help and tell if i am doing any thing wrong.
Note: I am using Facebook sdk.