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

Get Google+ token #26

Open
ChrisMCMine opened this issue Jul 30, 2014 · 11 comments
Open

Get Google+ token #26

ChrisMCMine opened this issue Jul 30, 2014 · 11 comments

Comments

@ChrisMCMine
Copy link

Please add support for retrieving the Google+ Token. Example [here](http://developer.android.com/reference/com/google/android/gms/auth/GoogleAuthUtil.html#getToken%28android.content.Context, java.lang.String, java.lang.String%29)

@ChrisMCMine ChrisMCMine changed the title Google+ Token missing Get Google+ token Jul 30, 2014
@gorbin
Copy link

gorbin commented Jul 31, 2014

Hello,

Yes, it's simple to add getAccessToken, but by your example there is problem.
Normaly most socialnetworksdk give access token right after initiation and we can get token at the same moment, but in google+ we need to reorgonize logic of getAccessToken - add interface and listener for it, so if it is really big deal to get Acces token from plus I can reorgonize lib, but I don't know is it good idea?

@antonkrasov
Copy link
Owner

@gorbin, I think it's not a problem, just implement common interface to get AccessToken as other requests, like requestAccessToken(Listener). For other social networks callback will be called immediately.

@gorbin
Copy link

gorbin commented Jul 31, 2014

@antonkrasov, yes, I mean this, it's not a problem, but maybe as I some one use it like me without listener, but now will ned llistener, just warning

@antonkrasov
Copy link
Owner

@gorbin, yes, I see, I think we can add requestAccessToken, and mark getAccessToken method as deprecated, and remove it after couple of new releases.

@ChrisMCMine
Copy link
Author

For now it would be possible to add GoogleAuthUtil#getToken to the AccessToken#getAccessToken method and let everyone handle the Thread/Asynctask themselves.
Or add a blockingGetAccessToken method for Google Plus beside one with a callback listener.

@antonkrasov
Copy link
Owner

@ChrisMCMine, I don't think it's a good idea, library was planned to be simple to use, so you can add it, initialize SocialNetworkManager and you shouldn't worry about anything else. People don't read docs, and they will have issues, if getAccessToken will be blocking... Sure we can check Thread in getAccessToken and throw an exception if it equals to Main, but it's much better just to add requestAccessToken.

@ChrisMCMine
Copy link
Author

yeah but I meant one method with callback/listener and a second optional one which performs a blocking request.

@gorbin
Copy link

gorbin commented Jul 31, 2014

Add in pull request interface and requestAccessToken, but save getAccessToken, I think it can be useful, at least for me)

@Aracem
Copy link
Contributor

Aracem commented Oct 7, 2014

@gorbin Do you make the pul request? I can't find the requestAccessToken in the main project

@gorbin
Copy link

gorbin commented Oct 8, 2014

@Aracem, yes I did pull(#28) request but it was closed - you can read why in it's tread.

But if you need tokens you can check ASNE(extended version of AndroidSocialNetworks) it is modular, got tokens, and much more(javadoc)

@Aracem
Copy link
Contributor

Aracem commented Oct 8, 2014

Thank you very much @gorbin , I will try your library

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

4 participants