Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

+ (void)setRequestAuthTokenOperation:(SSDKRequestTokenOperation)operation; 这个方法设置了没有回调 #56

Open
Aoce opened this issue Mar 17, 2021 · 1 comment

Comments

@Aoce
Copy link

Aoce commented Mar 17, 2021

如题,微信平台注册的时候appSecret传的是nil,其它白名单什么的都有设置,但服务端不想让客户端来获取用户信息,我们这边传authCode给服务端,服务端来获取微信用户信息,结果配置了上面方法,没有回调.

注册代码如下:
[ShareSDK registPlatforms:^(SSDKRegister *platformsRegister) {
[platformsRegister setupWeChatWithAppId:@"wx123453892392893829" appSecret:nil universalLink:@"https://12kj3ljl3j4l3j5l3jl5j3lj2l3jl2j3l2.share2dlink.com/"];
}];

调用代码如下:
[WeChatConnector setRequestAuthTokenOperation:^(NSString *authCode, void (^getUserinfo)(NSString *uid, NSString *token)) {
NSLog(@"authCode = %@", authCode);
}];

    [ShareSDK authorize:SSDKPlatformTypeWechat settings:nil onStateChanged:^(SSDKResponseState state, SSDKUser *user, NSError *error) {
        if (state == SSDKResponseStateSuccess){
            user.credential.authCode = [NSString stringWithFormat:@"%@", authCode];
            NSLog(@"%@", [user.credential rawData]);
            NSLog(@"%@", user.rawData);

        } else {
            NSLog(@"%@",error);
        }
  }];

然后能调起来微信,并能返回微信用户信息,这是为什么?API介绍上面不是说,appSecret传nil的时候,你们会做判断吗?然后setRequestAuthTokenOperation就会收到回调?

@Aoce
Copy link
Author

Aoce commented Mar 18, 2021

我知道了,在你们平台下的分享设置,社会化平台设置里面,也不要填AppSecret

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant