4

我正在尝试使用应用程序在 Facebook 中分享文本。我可以登录,但是当我尝试分享文本时得到这个 在此处输入图像描述

一旦我点击确定,一切都消失了,我在设备中登录 Facebook 应用程序仍然要求登录

#import <FBSDKShareKit/FBSDKShareKit.h>

  FBSDKShareLinkContent *content1 = [[FBSDKShareLinkContent alloc] init];
    content1.contentURL = [NSURL URLWithString:@"http://en.wikipedia.org/wiki/Facebook"];

    content1.contentDescription=content;
    content1.contentTitle=@"Hello";
   // content1.imageURL=imageURL;
    [FBSDKShareDialog showFromViewController:self withContent:content1 delegate:nil];

在日志中获取此信息

plugin com.apple.share.Facebook.post invalidated
4

2 回答 2

2

这工作正常。

-(IBAction)shareAction:(id)sender

{

    FBSDKShareLinkContent *content1 = [[FBSDKShareLinkContent alloc] init];
    content1.contentURL = [NSURL URLWithString:@"http://en.wikipedia.org/wiki/Facebook"];
    content1.contentTitle=@"Share";
    [FBSDKShareDialog showFromViewController:self withContent:content1 delegate:nil];
}
于 2016-01-21T11:11:36.073 回答
0
- (IBAction)shareActionButton:(id)sender {



     NSString *textToShare = @"Your Text to share";
        NSURL *myWebsite =[NSURL URLWithString:@"Your URL"];
        NSArray *objectsToShare = @[textToShare, myWebsite];
        UIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithActivityItems:objectsToShare applicationActivities:nil];
        [self presentViewController:activityVC animated:YES completion:nil];

}  
于 2016-01-21T11:03:09.130 回答