4

I am try to share text in Facebook using app. i am able to do login but when i tried to share text getting this enter image description here

Once i clicked ok every thing is gone and i am logged in Facebook app in device still asking to log in

#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];

getting this in log

plugin com.apple.share.Facebook.post invalidated
Sport
  • 8,570
  • 6
  • 46
  • 65

2 Answers2

2

This is working fine.

-(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];
}
Bhumit Mehta
  • 16,278
  • 11
  • 50
  • 64
Uma Madhavi
  • 4,851
  • 5
  • 38
  • 73
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];

}  
Sport
  • 8,570
  • 6
  • 46
  • 65
Ahmed Abdallah
  • 2,338
  • 1
  • 19
  • 30