将iOS中的应用邀请发送给Facebook朋友时出错 [英] Error in sending app invitation in ios to facebook friends

查看:119
本文介绍了将iOS中的应用邀请发送给Facebook朋友时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试向Facebook朋友发送应用邀请,但出现以下错误

I am trying to send app invitation to facebook friends but getting the following error

app invite error:Error Domain=com.facebook.sdk.core Code=9 "The operation couldn’t be completed. (com.facebook.sdk.core error 9.)"

下面是我的代码

-(IBAction)buttonTapped:(id)sender {
FBSDKAppInviteContent *content = [[FBSDKAppInviteContent alloc] init];
content.appLinkURL = [NSURL URLWithString:@"https://fb.me/115385318808986"];
[FBSDKAppInviteDialog showWithContent:content
                             delegate:self];

}

#pragma mark - FBSDKAppInviteDialogDelegate

- (void)appInviteDialog:(FBSDKAppInviteDialog *)appInviteDialog didCompleteWithResults:(NSDictionary *)results
{
  // Intentionally no-op.
}

- (void)appInviteDialog:(FBSDKAppInviteDialog *)appInviteDialog didFailWithError:(NSError *)error
{
NSLog(@"app invite error:%@", error);
NSString *message = error.userInfo[FBSDKErrorLocalizedDescriptionKey] ?:
@"There was a problem sending the invite, please try again later.";
NSString *title = error.userInfo[FBSDKErrorLocalizedTitleKey] ?: @"Oops!";

[[[UIAlertView alloc] initWithTitle:title message:message delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil] show];
}

,当我尝试打印error.userInfo时,它显示空白字典.请指导.

and when I am trying to print the error.userInfo it shows a blank dictionary. Please guide.

推荐答案

如果您一直在找我这样的地方,弄清楚为什么它不起作用,那么Facebook就会弃用 App邀请,并且会从 2/6/2018 完全停止工作:

If you've been looking everywhere like me to figure out why it's not working, turns out Facebook is deprecating App Invites and will completely stop working as of 2/6/2018:

https://developers.facebook. com/blog/post/2017/11/07/changes-developer-offerings/

这篇关于将iOS中的应用邀请发送给Facebook朋友时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆