gpt4 book ai didi

ios - Google Plus SDK 回调分享

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:12:31 25 4
gpt4 key购买 nike

我已经为 ios 集成了 Google Plus SDK 并设置了所有内容以供共享。但是在打开共享显示弹出窗口然后用户共享或取消共享之后是否有回调。我想知道它所说的委托(delegate)方法。我知道 -(void)finishedSharingWithError:(NSError *)error 是委托(delegate)方法,但它没有被调用。这是我通过 google plus 分享的代码..

  -(void)postToGooglePlus:(PostModel *)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)finishedSharingWithError:(NSError *)error{
if(!error){
}
}

最佳答案

您必须设置 <GPPShareDelegate>首先到你的 View Controller 。在那之后设置 delegate在你的 - (void)finishedWithAuth: (GTMOAuth2Authentication *)auth error: (NSError *) error 中这样方法:

id<GPPNativeShareBuilder> shareBuilder = [[GPPShare sharedInstance] nativeShareDialog];
[GPPShare sharedInstance].delegate = self;

您现在可以调用 -(void)finishedSharingWithError:(NSError *)error-(void)finishedSharing:(BOOL)shared相应地。

关于ios - Google Plus SDK 回调分享,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32604714/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com