firebase-unity-sdk icon indicating copy to clipboard operation
firebase-unity-sdk copied to clipboard

Google Sign-in Support in Auth Sample

Open paulhayes opened this issue 8 years ago • 20 comments

Hi guys,

I love Firebase, but it's pretty important to be able to use google sign-in easily. Unfortunately both the documentation and these samples give no guidance there. It's a bit of a documentation hole.

The auth example given in this repo is email+password, which isn't as useful as a google sign-in, which is quicker and users are more likely to use. Sadly the documentation just forwards you to the native Android page to solve this. As the example given in the android page uses a new activity it's non trivial to implement either in Unity or as a separate module.

whole can of worms

It would be incredibly useful if a practical example was made and/or a separate aar module that can be used from within Unity for launching the sign-in with a call back that returns the required token.

All the best. And thanks for making such a great library.

paulhayes avatar Jun 09 '17 08:06 paulhayes

Hi Paul,

We're working with the Google Sign-in team at the moment for a solution that makes it easier to integrate for Unity developers. We don't have a release date for this functionality yet but we'll let you know when it's ready.

For the moment, if you really want to use Google Sign-In / Google Play Games Sign-In you'll need to write your own C# -> Java / Obj-C bindings to the libraries in order to get the appropriate tokens to pass to Firebase Auth.

Cheers, Stewart

On Fri, Jun 9, 2017 at 1:56 AM, Paul Hayes [email protected] wrote:

Hi guys,

I love Firebase, but it's pretty important to be able to use google sign-in easily. Unfortunately both the documentation and these samples give no guidance there. It's a bit of a documentation hole.

The auth example given in this repo is email+password, which isn't as useful as a google sign-in, which is quicker and users are more likely to use. Sadly the documentation https://firebase.google.com/docs/auth/unity/google-signin just forwards you to the native Android page to solve this. As the example given in the android page uses a new activity it's non trivial to implement either in Unity or as a separate module.

[image: whole can of worms] https://user-images.githubusercontent.com/636239/26968112-b932e032-4cf8-11e7-9a44-f803504fcc25.PNG

It would be incredibly useful if a practical example was made and/or a separate aar module that can be used from within Unity for launching the sign-in with a call back that returns the required token.

All the best. And thanks for making such a great library.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <firebase/firebase-unity-sdk#270>, or mute the thread https://github.com/notifications/unsubscribe-auth/AFw1RFgFFyXpMtiikrVS4NGa6F2FMV4Xks5sCQjJgaJpZM4N1FMA .

stewartmiles avatar Jun 09 '17 14:06 stewartmiles

Hey Stewart, thanks so much for getting back to me. It's good to know you're aware of the gap. I've been working on my own solution in the meantime. If it feels general purpose, and if my client agrees, I might post a link to the repository here for others that want to achieve the same thing.

All the best Paul

paulhayes avatar Jun 10 '17 10:06 paulhayes

+1 for this. Really need simpler google login for unity to attach it with firebase.

Play game services plugin doesn't work properly for ios.

xysverma avatar Jun 14 '17 10:06 xysverma

I'm afraid the solution I've written @sourabhverma is for android only. I hope they do address this soon, my solution is far from foolproof anyway.

paulhayes avatar Jun 16 '17 09:06 paulhayes

I have spent days trying to integrate Google sign-in for android with unity. If someone has a solution please post it. I am at a complete lose. As OP says, Google sign in would be the quickest and most user friendly way of allowing our user base to access our games.

kc88 avatar Jun 28 '17 03:06 kc88

Then the whole 'Google Sign-In' section should be updated to simply say it can't be done. I wasted 30-45 minutes before stumbling upon this page from my Googling. A more amateur developer might end up wasting much more.

ayushvora avatar Jul 07 '17 09:07 ayushvora

I've got it working. But I've had problems making a stand alone library to share with others. I've got some time next week. So will try to fix the bug then.

paulhayes avatar Jul 07 '17 10:07 paulhayes

@paulhayes , @kc88 & @ayushvora : Since i really needed it, I have put together a module which i am using in my own game for google login and is now available in Asset Store. https://www.assetstore.unity3d.com/en/#!/content/94517

xysverma avatar Jul 20 '17 18:07 xysverma

Great stuff @sourabhverma, the version I created wasn't easy to seperate from my project, so it's good to see someone has made a general purpose solution, Will buy and review.

paulhayes avatar Jul 25 '17 11:07 paulhayes

@paulhayes : Great. Let me know how the integration went. Shouldn't take more than 10 mins usually. I am putting together a video tomorrow, however readme is simple enough for anyone to follow. Ping me if u face any trouble.

xysverma avatar Jul 25 '17 12:07 xysverma

@sourabhverma where would you like me to report bugs, or post fixes? FYI there's an unused using statement for UnityEditor.iOS.Xcode in LCGoogleSignInPostProcess.cs which you can remove. Also it might be worth adding #if UNITY_IOS conditional compilation directives to prevent compile errors when building for android.

paulhayes avatar Jul 27 '17 16:07 paulhayes

Thanks for letting me know this. For any report etc. I am moving this discussion to gitter and will be the default place for reporting bugs too. Email is also good.

https://gitter.im/Locomotion/LocomotionUnity

xysverma avatar Jul 28 '17 01:07 xysverma

There is now a Unity plugin for Google Sign-in https://github.com/googlesamples/google-signin-unity we still need to update the sample and the docs to utilize the new plugin.

stewartmiles avatar Oct 19 '17 16:10 stewartmiles

Hi Paul, We're working with the Google Sign-in team at the moment for a solution that makes it easier to integrate for Unity developers. We don't have a release date for this functionality yet but we'll let you know when it's ready. For the moment, if you really want to use Google Sign-In / Google Play Games Sign-In you'll need to write your own C# -> Java / Obj-C bindings to the libraries in order to get the appropriate tokens to pass to Firebase Auth. Cheers, Stewart On Fri, Jun 9, 2017 at 1:56 AM, Paul Hayes @.***> wrote: Hi guys, I love Firebase, but it's pretty important to be able to use google sign-in easily. Unfortunately both the documentation and these samples give no guidance there. It's a bit of a documentation hole. The auth example given in this repo is email+password, which isn't as useful as a google sign-in, which is quicker and users are more likely to use. Sadly the documentation https://firebase.google.com/docs/auth/unity/google-signin just forwards you to the native Android page to solve this. As the example given in the android page uses a new activity it's non trivial to implement either in Unity or as a separate module. [image: whole can of worms] https://user-images.githubusercontent.com/636239/26968112-b932e032-4cf8-11e7-9a44-f803504fcc25.PNG It would be incredibly useful if a practical example was made and/or a separate aar module that can be used from within Unity for launching the sign-in with a call back that returns the required token. All the best. And thanks for making such a great library. — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#88>, or mute the thread https://github.com/notifications/unsubscribe-auth/AFw1RFgFFyXpMtiikrVS4NGa6F2FMV4Xks5sCQjJgaJpZM4N1FMA .

So, what kind of login methods are you providing other than email login that works on unity. Duplicate of #

Praffulbharti avatar Sep 19 '18 10:09 Praffulbharti

@all and @xysverma I also came across this issue but unable to get a suitable solution.

Please post or update the current plugin, which has the solution of the thread.

Thanks

brijesh-brk avatar Apr 05 '20 07:04 brijesh-brk

@ALL and @xysverma I also came across this issue but unable to get a suitable solution.

Please post or update the current plugin, which has the solution of the thread.

Thanks

Can you not use this now? https://github.com/googlesamples/google-signin-unity

paulhayes avatar Apr 05 '20 08:04 paulhayes

https://github.com/googlesamples/google-signin-unity has 2 issues:

  1. For iOS it uses UIWebView which is no longer being accepted by the Apple Store. There is fixed in a branch but isn't in the main version

  2. Proguard breaks the solution, so if you have a larger app and you are using Minify to get around the 64k dex table issue, Google Sign-in breaks. This should be fixable by providing the right '-keep' options for Proguard, but I haven't been able to get it working yet. This is taking a huge amount of time for something that should be easy.

kromley avatar May 06 '20 13:05 kromley

3 years later, and the documentation still says "Just do it like you would in Android and iOS, it's literally that easy lmao."

Ok FB, very cool. 👌

KevinLDAS avatar Nov 30 '20 22:11 KevinLDAS

This repo https://github.com/googlesamples/google-signin-unity is not updated for 4 years and so it not reliable anymore. And to follow the step of android and ios in unity project is not very sensible

Since firebase is already under google. Please just integrate google signin as default signin method into firebase already. There are no reason to get idtoken from sidestepping method

On the other hand. Firebase Auth unity package could be splitted into AuthCore and each signin provider could have their own sub package that include its own depended package. Such as Auth.Google will include google signin

Anyway I would like to ask firebase to do something about google signin for unity. Current workflow is too hard to follow

Thaina avatar Jul 29 '22 03:07 Thaina

6 years later and only change is just that the name of library was changed to ios+ ?

image

Thaina avatar Apr 13 '23 10:04 Thaina