Objective C委托类功能

时间:2018-08-03 22:41:21

标签: ios objective-c delegates fbsdk

任何人都可以解释FBSDKAppInviteDialog是否由自己实现吗?

- (IBAction)handleFacebookShare:(id)sender {
//  SLComposeViewController *controller = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeFacebook];
//   NSString *message = [SocialShareHelper messageFBFromUser:[BMUserManager sharedInstance].selfProfile.username];
//   [controller setInitialText:message];
//   [controller addURL:[NSURL URLWithString:[[BMUserManager sharedInstance] shareAppLink]]];
//   [controller addImage:[UIImage imageNamed:@"share_logo"]];
//   [controller setCompletionHandler:[self createGAIHandler:@"social" forAction:@"facebook"]];
//    
//    [self presentViewController:controller animated:YES completion:nil];
    FBSDKAppInviteContent *content =[[FBSDKAppInviteContent alloc] init];
    content.appLinkURL = [NSURL URLWithString:@"https://fb.me/**"];
    //optionally set previewImageURL
    content.appInvitePreviewImageURL = [NSURL URLWithString:@"http://**.jpg"];
    // present the dialog. Assumes self implements protocol `FBSDKAppInviteDialogDelegate`
    [FBSDKAppInviteDialog showFromViewController:self withContent:content delegate:self];
}

0 个答案:

没有答案