Can I use UIActivityViewController to share on Facebook ?

后端 未结 2 1699
北恋
北恋 2021-01-02 19:21

I am trying to use UIActivityViewController to share on facebook. When I am using the

UIImage* image = [UIImage imageNamed:@\"image1.png\"];
NSArray* dataT         


        
相关标签:
2条回答
  • 2021-01-02 20:02

    Try this: if you want only facebook icon to share:

    -(IBAction)shareButtonPressed:(id)sender { NSLog(@"shareButton pressed");
    
    NSString *texttoshare = _txt;
    UIImage *imagetoshare = _img;
    NSArray *activityItems = @[texttoshare, imagetoshare];    
    UIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithActivityItems:activityItems applicationActivities:nil];
    activityVC.excludedActivityTypes = @[UIActivityTypeAssignToContact, UIActivityTypePrint, UIActivityTypePostToTwitter, UIActivityTypePostToWeibo];
    [self presentViewController:activityVC animated:TRUE completion:nil];
    }
    

    //in the list of excluded activity type insert any other kind of activitytypes you want to exclude

    0 讨论(0)
  • 2021-01-02 20:18

    you must be logged in your iphone settings: Settings -> facebook

    0 讨论(0)
提交回复
热议问题