Quickblox Google Login

2019-01-20 14:40发布

I have already implemented Facebook login with my quickblox application, but I was wondering if there was any way to implement Google login as well? There's nothing on their documentation that would suggest that, but I was just wondering if anyone on here has figured out how to do it? Thanks!

1条回答
beautiful°
2楼-- · 2019-01-20 14:48

QuickBlox doesn't support Google+ out of the box like Twitter and Facebook,

but, anyway, you can implement Google+ login.

For example, you have Google+ email and you would like to use it to login to QuickBlox,

here is what you can do:

NSString *googleEmail = @""; 

[QBUsers logInWithUserEmail:googleEmail password:[googleEmail hash] delegate:self];

First time when you do this - this request will fail because you don't have such user.

You need to process this error and create new user:

QBUUser *user = [QBUUser user];
user.email = googleEmail;
user.password = [googleEmail hash];

[QBUsers signUp:user delegate:self];

and then repeat login request.

Fore more info you can refer Users code sample

And you can build password using any algorithm you want, this just an example with hash

make sense?

查看更多
登录 后发表回答