Reputation: 1130
I want to invite my Facebook friend to use my application. I got success to invite them but i want their Facebook Id for my track that to whom i have invited. I am using FBSDKAppInviteDialog for invite friend. Is there any way to get Facebook Id after invite them ?. Below is my code of invite facebook friend.
#pragma mark
#pragma mark - Share via facebbok
- (IBAction)btnShare:(id)sender
{
FBSDKAppInviteContent *content =[[FBSDKAppInviteContent alloc] init];
content.appLinkURL = [NSURL URLWithString:@"https://fb.me/863075563772717"];
//optionally set previewImageURL
// present the dialog. Assumes self implements protocol `FBSDKAppInviteDialogDelegate`
[FBSDKAppInviteDialog showWithContent:content
delegate:self]; // Do any additional setup after loading the view, typically from a nib.
}
-(void)appInviteDialog:(FBSDKAppInviteDialog *)appInviteDialog didCompleteWithResults:(NSDictionary *)results
{
NSLog(@"result::%@",results);
}
-(void)appInviteDialog:(FBSDKAppInviteDialog *)appInviteDialog didFailWithError:(NSError *)error
{
NSLog(@"error::%@",error);
}
Thanks in Advance :)
Upvotes: 1
Views: 191
Reputation: 335
Facebook has been restricting its the policy for inviting friends to your app and unlike with FBWebDialogs in older SDK versions you cannot get the selected friends ids or any other kind of information FBSDKAppInviteDialog.
However, you could use a Dynamic App Link end point with a referral code. You can have a look to the documentation here: https://developers.facebook.com/docs/app-invites/ios#app_links That way, at least you would know the friends that have accepted the invitation and who invited them. Enough for most of the referral features you may need to implement.
That's if the app you are developing is not a game, otherwise it is much easier. Then you would be able to use FBSDKGameRequestDialog or the invitable_friends method of the Graph API, if you want to draw a custom interface for that.
Hope it helps.
Not directly related to your question, this might be interesting for you if you are trying to implement a kind of referral system: https://developers.google.com/app-invites/
Upvotes: 2