Google Play Authentication with Firebase in Unity 2023

Поділитися
Вставка
  • Опубліковано 12 вер 2024
  • A full video guide on how to add Google Play authentication with Firebase in Unity in 2023, after the big change in the middle of 2022.
    Read the GitHub guide : github.com/Nic...

КОМЕНТАРІ • 99

  • @andrewmuir3302
    @andrewmuir3302 Рік тому +1

    This solved it for me. This has been a wild ride!!!! A lot of the stuff you've done, I found in dribs and drabs all over the internet and had done already. As you noted early on, Google has changed things and not yet updated their documentation. The how-to articles don't connect a few CRUCIAL dots in this puzzle. For me, it was using that auto generated oauth client id and client secret everywhere throughout my app. Thanks for putting this video together.

  • @lazygoosegames702
    @lazygoosegames702 Рік тому +2

    Thanks for this video, I was having serious issues with the old package and the documentation for the new package is not the greatest. The github guide really helped too thanks!

  • @sj.dad-korea
    @sj.dad-korea Рік тому +1

    This video is the best of any 11.01 video I've seen

  • @sj.dad-korea
    @sj.dad-korea Рік тому +1

    Seriously, I respect and appreciate you guys. And Google should reflect. It seems that it has become a different system from version 10 to version 11.

    • @nichathangaming
      @nichathangaming  Рік тому

      Yes, hopefully Google and Unity will take their documentation more seriously in the future.

  • @TwixtorAnimeFree
    @TwixtorAnimeFree Рік тому +1

    it's very help thanx!!!
    first i just wanna ask, this test login must be uploaded to playstore first?

    • @nichathangaming
      @nichathangaming  Рік тому +1

      No, you don't need a release to test the login

    • @TwixtorAnimeFree
      @TwixtorAnimeFree Рік тому +1

      @@nichathangaming thanx

    • @gorik333
      @gorik333 Рік тому

      @@nichathangaming hello, i have problem, i download apk, and text is always canceled, I should upload to tests on play console?

  • @sj.dad-korea
    @sj.dad-korea Рік тому +1

    I was confused at the part where "OAuth 2.0 Client ID" was designated as the web-client automatically generated by Google service (I already made one myself, so I thought it should be done), but in the end, through your video and kind Git, I couldn't solve it for 3 days The problem was solved in 3 hours.

    • @nichathangaming
      @nichathangaming  5 місяців тому

      I am very glad to hear that. I had the exact same issue which is why I made the video.

  • @zivabutbul
    @zivabutbul 5 днів тому

    Hey I have some problem you guide work fine! In build apk but when I build aab and splite binary it's didn't start the play games you know why?

  • @mysteriousanayasman5416
    @mysteriousanayasman5416 Рік тому +1

    Thank you so much, I was struggling with Google Play Authentication as I searched UA-cam along with the documentation and it was a mess and I had to discard it all and ended up using anonymous and manual sign up with an Email and password within Firebase.
    I have an enquiry; how to activate App Check in the firebase within Unity?

    • @nichathangaming
      @nichathangaming  Рік тому +1

      I am very happy that this video has helped you out.
      To setup App Check you should just need to go to your Google Play Console then Releases->Setup->App Integrity and link your project. If there is more interest in this, I may make a video when I am done with my ads tutorial.

  • @randon.integer
    @randon.integer 5 місяців тому

    Great tutorial! Thank you! But I still have a question, how to test it in unity player?

    • @nichathangaming
      @nichathangaming  5 місяців тому

      Unfortunately, you will need to build to a device to test this. It should work building to a computer but your google accounts are not connected to the Unity Editor.

  • @PirateDave83
    @PirateDave83 Рік тому +2

    Hi, thank you for this video. I finally undestand how to connect Firebase to Google Play Service.
    But afterwards I fall into another issue. This is working for me only on local and/or internal test mode. As I upload app to Play Store it doesn't connect anymore.
    I've try to change the client secret file (from Upload to Signin key) but it's not working.
    Any help is accepted.
    Thanks anyway ...

    • @nichathangaming
      @nichathangaming  Рік тому

      Thank you for your comment. I wish I had time to respond sooner because I know how frustrating this process can be. Without seeing anything else, I can only assume that there might be an issue in your Firebase-Authentication-Settings-Authorized Domains or in your Firebase-Realtime Database-Rules.
      Good luck troubleshooting your issues.

  • @JoeHobbiesfun
    @JoeHobbiesfun Рік тому +1

    Thank you this works for me, can you please make video for connecting firebase auth with firebase database as well?

    • @nichathangaming
      @nichathangaming  Рік тому +1

      I am currently working on a tutorial series for adding Firebase Realtime Database with Google Play OAuth, multiplayer matches and Advertisements.
      If I remember, I can send you a link when it's done.

    • @JoeHobbiesfun
      @JoeHobbiesfun Рік тому

      @@nichathangaming Thank you Nichathan, it is a really helpful series, subscribed👏

    • @nichathangaming
      @nichathangaming  Рік тому +1

      I became a bit busy over the past few months so I have made a quick video on connecting with Firebase Realtime database while I am working on my larger tutorial series. If you are interested, you can watch it at : ua-cam.com/video/uABgY1m_D-o/v-deo.html

  • @sixstarbro5963
    @sixstarbro5963 10 місяців тому +1

    Oh my god your life saver tnx bro

  • @ahmetburak2556
    @ahmetburak2556 7 місяців тому +1

    thank you so muchhhhhhhh!!!

  • @Heizungsmechaniker
    @Heizungsmechaniker Рік тому +1

    Hey, I need help with the Leaderboard. The Google Play Authentication works perfectly. But my leaderboard only shows up one score from the same user. There is no user who can uploud their own score, to display himself with more than 1 player in the leaderboard
    Can You help?

    • @nichathangaming
      @nichathangaming  Рік тому

      I have not yet done a tutorial on implementing the Google Play Console Leaderboard yet but I may in the future.

  • @hexmort2022
    @hexmort2022 Рік тому

    I watched the most useful content

  • @devalmistry1
    @devalmistry1 Рік тому +1

    Hi it's really helpful tutorial. please do the same for sign in with iOS and sign in with facebook also. it will great help of others.

    • @nichathangaming
      @nichathangaming  Рік тому

      Unfortunately, I don't have an I Phone or any Macintosh devices so while I probably could do IOS and Macintosh builds, I'm just not comfortable releasing content that I'm unable to test. If I am able to obtain these products in the future, I will definitely make tutorials on them.
      As for a Facebook Authentication, I'll be working on that soon so please check my channel later.

  • @jendimir2935
    @jendimir2935 7 місяців тому

    Thanks for the guide The Web Client secret in firebase can be different then the Client secret in Google Cloud? or i should rewrite the Firebase one so it matches the googles one

    • @nichathangaming
      @nichathangaming  7 місяців тому +1

      Unfortunately, I have always had to follow the steps in the video exactly to have my app function properly. You can also read the GitHub guide I typed to support the video. There is also a link in the video description.
      github.com/Nichathan-Gaming/GooglePlayAuthenticationInUnityWithFirebase

  • @Wangak3
    @Wangak3 Рік тому +1

    Hi I'm Korean and your videos and materials have been really helpful for me. I always want to know how you find out and create this information because I only know how to do google and youtube searches.Thanks again

    • @nichathangaming
      @nichathangaming  Рік тому +1

      I'm glad you asked and I'm really glad that my videos have helped you out.
      I learn how to do everything that I do by :
      Research - Read the documentation, look for examples on GitHub/Stack Overflow/UA-cam
      Forums - I always like to ask/answer and read forum posts unfortunately, humans are not good creatures and they don't like differentiating opinions.
      And most importantly, I Experiment - When I have an issue, Research and Forums can only bring me so far. That is why I spend most of my time seeing if something works and then adjusting the values when it doesn't.
      If you're interested, I have a video where I talk about all of this here : ua-cam.com/video/4dK_Jolcm7Q/v-deo.html

    • @Wangak3
      @Wangak3 Рік тому

      ​@@nichathangamingThank you so much, thanks to you I am able to take one more step forward! I love your insights.

  • @Captivest
    @Captivest 9 місяців тому +1

    How did you find the client secret? I just can’t find it anywhere

    • @nichathangaming
      @nichathangaming  9 місяців тому

      If the video isn't clear enough, you can find a detailed guide on my GitHub in the video information.

    • @Captivest
      @Captivest 9 місяців тому

      Nevermind my bad, found it thanks

  • @MartianHunter
    @MartianHunter Рік тому +1

    Hey, can you share the process of google auth login with firebase (without playgames).

    • @nichathangaming
      @nichathangaming  Рік тому

      I don't believe that you can do it without Google Play Games. It might be possible if you create the credentials manually.

  • @AxundMuslim
    @AxundMuslim Рік тому +1

    error CS0019: Operator '==' cannot be applied to operands of type 'bool' and 'SignInStatus'

    • @nichathangaming
      @nichathangaming  Рік тому

      That is correct, a boolean value can not be compared to a SignInStatus enum. You may want to check if ```status == SignInStatus.Success```

  • @PlayBurgh
    @PlayBurgh Рік тому +2

    Hi @nichathangaming, I am having trouble to upload icon under "Play Games Services > Configuration" I have done every solution of Google support gave me on live chat. However, it just gives "Couldn't Upload. Try Again" Error. and the top of the page it show "Some languages have errors". Do you have any ideas why it could be? since I cant upload the icon I cant continue to publish. thanks a lot.

    • @nichathangaming
      @nichathangaming  Рік тому

      Are you trying to upload a game Icon in Unity or the Google Play console? You may need an icon in both areas. Icons are recommended to be 512x512px .png image files.
      This may help :
      In Unity, go to Edit -> Project Settings -> Player -> Default Icon
      In the Google Play Store, go to Grow/Store presence/Main store listing -> Graphics -> App Icon

    • @PlayBurgh
      @PlayBurgh Рік тому +1

      @@nichathangaming I am trying to upload to Google Play Console. "Play Games Services > Configuration" as you show on your video here. I followed all the regulations about image specifications however it is just not uploading image.

    • @nichathangaming
      @nichathangaming  Рік тому

      @@PlayBurgh That is very odd, if you are following all of the steps then there should be no issue adding icons.
      I personally do not have a Configuration tab in my Play Games Console so I am unsure of where you are trying to upload icons to. I only have Release, Grow, Quality, Monetize and Policy and Programs.
      You may wish to contact the Google Play Console Help Desk by clicking the question mark in the top right of the screen.

    • @ryllealbertcagas9407
      @ryllealbertcagas9407 Рік тому +1

      @@nichathangaming is it necessary for the app to be published in play store?

    • @ryllealbertcagas9407
      @ryllealbertcagas9407 Рік тому +1

      We have the same issues, have you found any solutions?

  • @online.fabian
    @online.fabian Рік тому

    When I open up my Mobile Game on the Android device, I get a black screen for 10 seconds and after the 10 seconds my game loads without the "Made with Unity" Screen
    Pls need help

    • @nichathangaming
      @nichathangaming  Рік тому

      That's very odd.
      1. Does it happen with an empty project?
      2. Did it start happening before or after you used my tutorial?
      3. Does this tutorial still work if you follow it in a new project?
      Note : Your issue sounds unrelated to the Google Play Authentication. You may get better responses asking on the official Unity forum (forum.unity.com/) or by accessing some of the many other Unity support services (unity.com/support-services).

  • @sam-xi9wk
    @sam-xi9wk Рік тому +1

    life saver

  • @gorik333
    @gorik333 Рік тому +1

    Hi, I have problem, I download apk, and displayText is always "canceled", when I launch .apk, should I upload to tests on google play console?

    • @gorik333
      @gorik333 Рік тому +1

      UPD. I found out how build abb thanks for your git hub guide, but anyway "Canceled"(

    • @nichathangaming
      @nichathangaming  Рік тому

      If you have an issue with the .apk file then you'll probably have trouble with the .aab file.
      If displayText is always canceled then you might have forgotten to connect it to the script or add the script to the scene.

    • @gorik333
      @gorik333 Рік тому

      @@nichathangaming no script on the scene, I will discard all changes and try again)

    • @nichathangaming
      @nichathangaming  Рік тому

      So I went through my tutorial for a larger class I'm designing and it's all worked for me.
      I did think of 1 issue that you might be having : the Google Play Authentication can only be tested on an Android phone. If you test in the Unity Editor then it will always say Failed or Canceled.

    • @nichathangaming
      @nichathangaming  Рік тому

      Also, if you don't see any output at all in your TMP_Text object then you might need to connect it to your Auth script.

  • @akrb3680
    @akrb3680 Рік тому +1

    Hello, how to build leader board ?

    • @nichathangaming
      @nichathangaming  Рік тому

      Unfortunately I do not have a tutorial on this yet.
      From what I know, you can go to your Google Play Console-Setup and management-Leaderboards
      Then you need to fill out and save the form.
      In Unity, you will need UnityEngine.SocialPlatforms
      You can use ```Social.ReportScore(int score, string id, callback() );``` to send a score to Google
      Social.ShowLeaderboardUI(); will display the default UI
      If you want the scores array to display in your own GUI, you can use ```Social.LoadScores(string id, callback(int[] scores));```
      You may also need to Authenticate the PlayGamesPlatform
      This guide is untested right now and in development but hopefully it can help you.

  • @sj.dad-korea
    @sj.dad-korea Рік тому

    I have a question.
    Somehow, there are too many OAuth 2.0 clients.
    2 auto created by google service .(type:web application)
    1 webclient (type: web application) created by me
    And the 2 webclients (type:android) I created
    Somehow, 5 of them were created... Actually, how many should be normal?
    I'm not going to delete it, but if I do, there will be problems with the service, right?

    • @nichathangaming
      @nichathangaming  Рік тому

      Depending on how you set up Firebase and the order you follow the steps, you can get around 5 different OAuth clients. I don't know if deleting them is bad but just use the ones with the code from your Firebase Auth area and it should be fine.

    • @sj.dad-korea
      @sj.dad-korea Рік тому +1

      @@nichathangaming thanks for the quick reply And I'm looking at other videos too. I don't know why your channel has so few subscribers. A lot of really good content. thank you

  • @ryllealbertcagas9407
    @ryllealbertcagas9407 Рік тому

    HEllo, what's seems to be the problem if uploading game icon fails?

    • @nichathangaming
      @nichathangaming  Рік тому

      A few things to take note of :
      1. App icons are added on the Google Play Console under Grow-Main Store Listing-Graphics-App Icon
      2. App icons should be a .png image file and not a .ico icon file or .jpg/jpeg image file.
      3. The file size of the icon image must not be more than 1 Megabyte(MB)
      4. The dimensions of the icon image must be 512x512 pixels(px)
      5. The icon images must meet the Google Play Console Metadata Policy (support.google.com/googleplay/android-developer/answer/9898842)
      6. The icon images must meet the Google Play Console Icon Design Specifications (developer.android.com/distribute/google-play/resources/icon-design-specifications)
      7. You should also have the same icon in your Unity player settings under Default Icon. (Make sure that after you import the .png image file to your Unity project that you convert it to a Sprite (2D and UI) image type.
      If you meet all of the above requirements and you still cannot upload an icon to the Google Play Console then please message the Google Play Console Help Desk for further support.

  • @aokisea
    @aokisea Рік тому +1

    Hi! I'm following this tutorial of yours but I'm having errors that shows this at the top
    "the supllied auth credentials is malformed or expired."
    Although it creates the user on firebase, this error message pops up instead of the "Fully authenticated" message.

    • @nichathangaming
      @nichathangaming  Рік тому

      That is odd, I followed the tutorial last week and I didn't have errors.
      I'll look more into your issue later. In the meantime, please compare your process with my Github guide in the description.

    • @aokisea
      @aokisea Рік тому +1

      @@nichathangaming Do you think it has something to do with my previous settings that I used for the console? I previously tried using unity services for play games log in.
      What settings do you recommend I should check because it might have something to do with OAuth IDs

    • @nichathangaming
      @nichathangaming  Рік тому

      Having multiple things in 1 project can definitely conflict with each other. It might be good to try creating a fresh project and copy/paste your non-auto-generated assets over then use that to start fresh.

    • @aokisea
      @aokisea Рік тому +1

      @@nichathangaming that's a great idea! Let me try that. I'll update you how it goes. Thanks a lot!

    • @aokisea
      @aokisea Рік тому +1

      Hi by the way. Is there a way to copy over the project settings specifically the layers, tags, etc.? It's a hassle re-applying them for each object since I wasn't able to make prefabs for all objects to mass edit

  • @md_rofique
    @md_rofique Рік тому +1

    Thanks

  • @hexmort2022
    @hexmort2022 Рік тому

    I want to make a game registration system in Unity, a system that can be registered by logging in with a google account.
    What I want to record;
    person name,
    Email,
    Password,
    Point,
    Game Money,
    special game currency,
    profile picture,
    player name,
    scores,
    Password Renewal,
    Register,
    Login,
    After the registration process is completed or after logging in, close the screen and direct it to the game screen.
    I want to pull the data from the server with the recorded scores and make a score table. I want to make data like Weekly scores, Monthly scores.
    I want to integrate the game points with the server and connect the game money to the server. I want all personal data recorded as well.
    Can ı help me

    • @nichathangaming
      @nichathangaming  Рік тому

      Thank you for your question, I just made a video explaining how to use the Firebase email and password sign in with Firebase Firestore although, I still recommend using Realtime database.
      Email and Password video : ua-cam.com/video/nCoxo0nkdDs/v-deo.html
      Realtime Database video : ua-cam.com/video/uABgY1m_D-o/v-deo.html

  • @calvinms7503
    @calvinms7503 Рік тому +1

    Afteropening the App, nothing happens. I checked into the log cat
    2023/07/18 09:02:26.487 5801 5801 Error SurfaceSyncer Failed to find sync for id=0
    2023/07/18 09:02:29.155 5801 5848 Warn Unity *** [Play Games Plugin 0.11.01] 07/18/23 9:02:29 +07:00 ERROR: Returning an error code.
    2023/07/18 09:02:29.155 5801 5848 Warn Unity GooglePlayGames.OurUtils.PlayGamesHelperObject:Update()
    2023/07/18 09:02:29.155 5801 5848 Warn Unity

    • @calvinms7503
      @calvinms7503 Рік тому +1

      I forgot to publish the Play Service ._.

    • @nichathangaming
      @nichathangaming  Рік тому

      Please make sure to test on an Android device too.

    • @calvinms7503
      @calvinms7503 Рік тому +1

      @@nichathangaming I did :)

  • @tommasodeste6842
    @tommasodeste6842 11 місяців тому

    Hello and thanks for the video, I followed all the steps, locally (if I download via cable from unity) it connects correctly with Google Sign In, however in the internal tests, even if I added the new Auth ID containing the SHA- 1 that was provided to me by Google Play Console, it doesn't work.
    The Google Play Sign In login icon isn't even shown at all and I get an error from the debugger.
    I don't know how to fix this problem.

    • @nichathangaming
      @nichathangaming  7 місяців тому

      If the video causes problems, you can read the GitHub guide I typed at github.com/Nichathan-Gaming/GooglePlayAuthenticationInUnityWithFirebase
      As Unity and Firebase change often some images may not match exactly. If the tutorial still isn't working, I can revisit this guide to see if it's changed.

  • @randompeople4115
    @randompeople4115 Рік тому

    can i save costume data like string or integer ?

    • @nichathangaming
      @nichathangaming  Рік тому

      Of course, if you want to save data locally, you'll want to use PlayerPrefs.SetString(saveName, saveData); or PlayerPrefs.SetInt(saveName, saveData); then just use PlayerPrefs.GetString(saveName, defaultValue); to retrieve it.
      If you want to save data to Firebase so it can be accessed remotely, that is very possible too. You just need to use Firebase Realtime Database or Firebase Firestore. There is a great little quiz here to help you decide which is best for your project : firebase.google.com/docs/database/rtdb-vs-firestore

  • @marawanhany1923
    @marawanhany1923 Рік тому

    Hi @Nichathan Gaming, firstly thank you for the amazing tutorial, really detailed and insightful, i followed all the steps and i think i got it really close to working all thanks to your awesome tutorial, but it doesn't quite work , what happens is that the game actually is that this part of the code (PlayGamesPlatform.Instance.Authenticate((status) => ) returns SignInStatus.Success and proceeds to the next step of authentication , this stage (PlayGamesPlatform.Instance.RequestServerSideAccess(true, code =>) where my game gets stuck and doesnt proceed at all, logcat returns this error (note that i tried adding Playgamesplatform.activate from searching online but it did nothing but also give a warning )
    [Play Games Plugin 0.11.01] 06/12/23 2:57:22 +02:00 ERROR: Requesting server side access task failed - com.google.android.gms.common.api.ApiException: 8:
    GooglePlayGames.OurUtils.PlayGamesHelperObject:Update()
    ApplicationException: server_auth_code
    at Firebase.Auth.PlayGamesAuthProvider.GetCredential (System.String serverAuthCode) [0x00000] in :0
    at OnlineServicesSO.b__5_0 (System.String code) [0x00000] in :0
    at GooglePlayGames.OurUtils.PlayGamesHelperObject.Update () [0x00000] in :0
    any help would be appreciated, i have been searching for a solution for 3 days now, i tried using the GPC -> app signing sha 1 and the keystore sha but to no avail am not really familiar with online services api's will need like 10 mins of your time, thank you for the awesome tutorial, and thank you for your time and have a nice day.

    • @marawanhany1923
      @marawanhany1923 Рік тому

      for 4 days now i have been trying to resolve it i narrowed it down to RequestServerSideAccess returning code string with null no matter what i do i double checked the code, which sha1 and client id to put and where i watched the tutorial 3 times now, its really annoying to be this close to have it working, but what can you do, any support would be appreciated, thank you for reading and have a nice day.

    • @marawanhany1923
      @marawanhany1923 Рік тому

      [solved] for some reason the (try - catch) arguments were interfering with the authentication execution

    • @nichathangaming
      @nichathangaming  Рік тому

      I'm really glad that you were able to solve that. Dealing with Firebase can be frustrating so I'm glad my video helped at least a little.