Im trying to send an app request through facebook using the facebook iOS SDK, im using the following code:
NSString *message = [[NSString alloc] initWithFormat:@"blah blah blah"];
NSString *data = [[NSString alloc] initWithFormat:@"blah blah blah"];
NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:message, @"message", data, @"data", nil];
[_facebook requestWithGraphPath:[NSString stringWithFormat:@"%@/apprequests",userID] andParams:params andHttpMethod:@"POST" andDelegate:self];
[message release];
[data release];
This gives me the following error:
Error: Error Domain=facebookErrDomain Code=10000 "The operation couldn’t be completed. (facebookErrDomain error 10000.)" UserInfo=0x788c5b0 {error=<CFBasicHash 0x788c080 [0x1bf53e0]>{type = mutable dict, count = 2,
entries =>
2 : <CFString 0x788b560 [0x1bf53e0]>{contents = "type"} = <CFString 0x788c3f0 [0x1bf53e0]>{contents = "OAuthException"}
3 : <CFString 0x788c560 [0x1bf53e0]>{contents = "message"} = <CFString 0x788c480 [0x1bf53e0]>{contents = "(#200) Invalid Request: There was a problem with the parameters of the request. Body of an error/warning message. Title is: Invalid Request"}
}
So has anyone been successful with this, or do you know of a way to send a request to a facebook user using the facebook iOS SDK?
Thanks
You can easily send the app request very easily by Using Facebook SDK
For Making App Request Please Make sure Following steps
1)Make sure you have added the latest Facebook SDK in Your Application Folder
if not,you may download from this link.
Now you just need to Add FBConnect Folder in your Project Folder.
2)Then Make sure you have Registered your iphone App as "App on Facebook" Type Select how your app integrates with Facebook under Basic App Settings.
if not,you can do that here.
NSString *friendId=@"FacebookId Of Your Friends";
NSLog(@"%@",friendId);
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"Hi please add me as a friend.", @"message",
friendId, @"to",
nil];
[appDelegate.facebook dialog:@"apprequests" andParams:params andDelegate:self];
Please Don't Forget To Adopt the FBdialogDelegate protocol first in your ViewController Class.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With