回忆没有FBSDKShareButton的didMoveToView

时间:2015-04-12 14:39:52

标签: ios objective-c facebook

在我的iOS应用中,我无法使用Facebook登录。

 FBSDKCoreKit/FBSDKCoreKit.h
 FBSDKLoginKit/FBSDKLoginKit.h
 Social/Social.h

-(void)didMoveToView:(SKView *)view
{
 FBLoginView *loginView = [[FBLoginView alloc] init];
loginView.delegate=self;
loginView.readPermissions=@[@"public_profile",@"email",@"user_friends"];
[self.view addSubview:loginView];
FBSDKShareLinkContent *content = [[FBSDKShareLinkContent alloc] init];   
content.contentURL = [NSURL URLWithString:@"https://developers.facebook.com"];

FBSDKShareButton *button = [[FBSDKShareButton alloc] initWithFrame:CGRectMake(0, 150, 200, 30)];
button.shareContent = content;

   [self.view addSubview:button];
}

0 个答案:

没有答案