delight-im / Android-DDP

[UNMAINTAINED] Meteor's Distributed Data Protocol (DDP) for clients on Android
Apache License 2.0
274 stars 54 forks source link

Google Login Handler #40

Closed cprakashagr closed 8 years ago

cprakashagr commented 8 years ago

Its an extension of the AndroidDDP lib for GoogleLoginHandler. See meteor.java and gPlusLoginHandler.js for details of the methods.

cprakashagr commented 8 years ago

I have added the LinkedIn Login Handler as well. Since the LinkedIn Android SDK access token can be used from the Mobile only and it doesn't provide any token for the server side verification, the user needs to send all the data from the method only.

ocram commented 8 years ago

Thank you so much, really well done!

Your two methods registerWithGoogle(...) and registerWithLinkedIn(...) from Meteor.java and the complete file socialAccountsLoginHandler.js are the important pieces that are required -- and they look good.

But I don't think those should have to be in the core library that is managed in this repository. Many developers will not need those login methods, for example.

Could you create a separate repository that you control, where only those three pieces are in? We would then link your repository here so that everybody who needs Google or LinkedIn sign-in can grab it from your repository.

What do you think?

cprakashagr commented 8 years ago

Hi, Thanks for your feedback. The file socialAccountsLoginHandler.js is indeed not needed in this repository. I added it as a part of example.

The methods which I have made in Meteor.java could probably be merged.

Though, I have forked this project here, Android-DDP where you can link this repository by the time I make a gist URL.

Thanks.

cprakashagr commented 8 years ago

Okay,

Done. Its here, Enhanced Android-DDP with social accounts login handler.

ocram commented 8 years ago

Great, thank you!

Shall we link to the repository that you created or to the Gist that you created? Both seem to contain the required code.

Moreover, I actually thought that you would just put the two methods (and maybe the JS file) into your repository/Gist. It would be much easier for developers to find what they're looking for in your repository/Gist, right? ;)

In addition to that, this main repository will continue to change. And if you copy the whole code and integrate the two methods into the Meteor.java file, you will always have to keep up with changes and copy them to your file again, you see?

cprakashagr commented 8 years ago

Yes, you are right.

Kindly refer to my gist. I'm updating it to the required methods only.

Thanks. :)

cprakashagr commented 8 years ago

Would you mind updating your README.md file as well?

ocram commented 8 years ago

I see that you have updated your Gist already :) Thank you!

We will add a new section for such extensions and update the README.md shortly.

Until then, we'll leave this pull request open.

ocram commented 8 years ago

The link to your Gist has been added now: https://github.com/delight-im/Android-DDP/commit/e27872193022bfc32e574ccf36c12d59e167ebc2

Is this okay?

cprakashagr commented 8 years ago

Yes. Thank you. :)