Reputation: 103
i'm using the facebook iOS sdk. I need to send friend requests between users of facebook, from an iOS app. I know that can not be sent via graph API. I'm trying to through dialog of facebook i do not know how. Can anyone help me?
This is my code:
Facebook *face = [[Facebook alloc] initWithAppId:@"APP_ID" andDelegate:self];
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
@"user_id", @"id",
nil];
[face dialog:@"me/friends"
andParams:params
andDelegate:self];
With this code i get a dialog with this text: "The page you requested was not found"
Upvotes: 4
Views: 2233
Reputation: 103
Ok I found a solution. I have created a NSMutableDictionary to make a "appRequest" with their corresponding parameters but finally indicated that the type of dialogue is a "friends". It's a strange solution but it works.
Facebook *face = [[Facebook alloc] initWithAppId:FBSession.activeSession.appID andDelegate:nil];
face.accessToken = FBSession.activeSession.accessToken;
face.expirationDate = FBSession.activeSession.expirationDate;
if ([face isSessionValid]){
NSMutableDictionary* params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
@"My Title", @"title",
@"Come check out my app.", @"message",
userId, @"id",
nil];
[face dialog:@"friends"
andParams:[params mutableCopy]
andDelegate:nil];
}
Upvotes: 1
Reputation: 8444
This may help you
NSDictionary* params = [NSDictionary dictionaryWithObjectsAndKeys: message, @"message", title, @"title", nil];
[[self facebook] dialog: @"apprequests"
andParams: [params mutableCopy]
andDelegate: delegate];
See this question for further details and also this document.
Upvotes: 0