FBSDKAppInvite成功,但不能在fbaccount中发送通知

我的info.plist

在这里输入图像说明

 FBSDKAppInviteContent *content =[[FBSDKAppInviteContent alloc] init]; content.appLinkURL = [NSURL URLWithString:@"https://fb.me/450262455167157"]; //optionally set previewImageURL content.appInvitePreviewImageURL = [NSURL URLWithString:@"https://www.apple.com/my_invite_image.jpg"]; // present the dialog. Assumes self implements protocol `FBSDKAppInviteDialogDelegate` [FBSDKAppInviteDialog showFromViewController: self withContent: content delegate: self ]; //FBSDKAppInviteDialog delegate -(void)appInviteDialog:(FBSDKAppInviteDialog *)appInviteDialog didCompleteWithResults:(NSDictionary *)results { NSLog(@"%@",results); } -(void)appInviteDialog:(FBSDKAppInviteDialog *)appInviteDialog didFailWithError:(NSError *)error { NSLog(@"%@",error); } 

该applink不是你的fb链接这是你的服务器PHP脚本链接,

 "http://ipaddress/folder/sample.php" 

码:

  FBSDKAppInviteContent *content =[[FBSDKAppInviteContent alloc] init]; content.appLinkURL = [NSURL URLWithString:@"http://ipaddress/folder/sample.php"]; //optionally set previewImageURL content.appInvitePreviewImageURL = [NSURL URLWithString:@"http://ipaddress/folder/image.jpg"]; // present the dialog. Assumes self implements protocol `FBSDKAppInviteDialogDelegate` [FBSDKAppInviteDialog showWithContent:content delegate:self]; 

说明:

1. appLinkURL – 我已经告诉过你是从你的服务器的脚本。 appInvitePreviewImageURL – 您也可以从同一台服务器调用图像。

appLinkURL包含(在sample.php中)示例appname = stackoverflow(在这里你应该添加你的appname)

码:

 <html> <head> <meta property="al:ios:url" content="stackoverflow://" /> <meta property="al:ios:app_store_id" content="123456789" /> <meta property="al:ios:app_name" content="stackoverflow'" /> <meta property="al:android:url" content="stackoverflow://" /> <meta property="al:android:app_name" content="stackoverflow" /> <meta property="al:android:package" content="com.mycompany.couchin" /> <meta property="al:web:url" content="http://google.com" /> </head> <body> Sample App </body> </html> 

说明:al:ios:url =这就是所谓的url模式,您应该将这个url模式添加到下面的info.plist示例中, 在这里输入图像说明

al:ios:app_store_id:添加appstore id,如果你没有appstore id,请添加示例应用程序已经在appstore中。

al:ios:app_name:在这里给你一个appname。

2.appInvitePreviewImageURL当您邀请您的朋友时,应该从链接中显示此图片。