我已经集成了适用于 ios 的 Google Plus SDK 并设置了所有内容以供共享。但是在共享显示弹出窗口打开后是否有回调,然后用户共享或取消共享。我想知道它说这个的委托(delegate)方法。
我知道 -(void)finishedSharingWithErrorNSError *)error
是委托(delegate)方法,但它没有被调用。
这是我通过 google plus 分享的代码..
-(void)postToGooglePlusPostModel *)parameter{
GPPSignIn *signIn = [GPPSignIn sharedInstance];
signIn.shouldFetchGooglePlusUser = YES;
signIn.clientID = kClientId;
signIn.scopes = @[ kGTLAuthScopePlusLogin ];
signIn.delegate = self;
[signIn authenticate];
}
- (void)finishedWithAuth: (GTMOAuth2Authentication *)auth
error: (NSError *) error {
NSLog(@"Received error %@ and auth object %@",error, auth);
id<GPPNativeShareBuilder> shareBuilder = [[GPPShare sharedInstance] nativeShareDialog];
[shareBuilder setPrefillText"This is a test"];
[shareBuilder open];
}
-(void)finishedSharingWithErrorNSError *)error{
if(!error){
}
}
您必须首先将
设置为您的 View Controller 。之后在你的 - (void)finishedWithAuth: (GTMOAuth2Authentication *)auth error: (NSError *) error
method:
delegate
id<GPPNativeShareBuilder> shareBuilder = [[GPPShare sharedInstance] nativeShareDialog];
[GPPShare sharedInstance].delegate = self;
您现在可以相应地调用 -(void)finishedSharingWithErrorNSError *)error
或 -(void)finishedSharingBOOL)shared
。 p>
关于ios - Google Plus SDK 回调分享,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32604714/
欢迎光临 OStack程序员社区-中国程序员成长平台 (https://ostack.cn/) | Powered by Discuz! X3.4 |