nevermind i found the issue the code is not the problem during that setup phase in the unit dashboard i only selected ios/android but not PC. but if you dont select PC then testing on PC in the editor doesnt work. please continue this series its really helpful :-)
Excellent video, could you make one using Play Games as a Provider? I saw that there are several options besides this one, but I couldn't adjust the code to use with Play Games... Thanks!
You can make a system easily, after you login , you can use the method for detecting already cached player, using the method below docs.unity.com/ugs/en-us/manual/authentication/manual/cached-players
Hi sorry for late reply, are you still having this issue? I wouldn't mind taking a look into it again, you'd have to provide me more detail on what going on or where is exactly that error appears. thanks!
Master! thanks to your video save my life how about the logout button which can be signout even credentials like session destroy and to able login another account and even the name can be modified/edit. can you make a video? ❤
it really difficult to follow your typing, some class are missing some class are don't know what namespace you used, you should add all script to description, so, people can easily copy them
@@navarone77 one think I want to say that when I click on login it will open a browser and try to login..but when it goes back after login from the browser ...the game will restart ..its seems its not running on background. .any solution ?
@@devonn6_ hmm that is strange, something might be wrong with your code I'm thinking. Just tested everything again and seems to work here. Perhaps try it on a brand new project just to test out?
Did you install the Authentication package ? Just tested it on Unity 2023 as well, it is still there in Project Settings after you install Authentication.
@@navarone77 yes i did but player accounts is not showing in services it shows online in the providers.. could it be the unity version issue ? i am using 2022.1.24f1
I did this and it is working. Now, all of the sudden the login when redirects me to unity log in on the browser gives "OOPPS Something is wrong!try to signing in again" Do you know what is happening?
Hi Thanks for watching! to Sign out you can call AuthenticationService.Instance.SignOut you can pass a bool in the method to clear credentials / stored session. Link to Docs: docs.unity.com/ugs/en-us/packages/com.unity.services.authentication/2.6/api/Unity.Services.Authentication.IAuthenticationService#Unity_Services_Authentication_IAuthenticationService_SignOut_System_Boolean_ You might also need to call PlayerAccountService.Instance.SignOut(); Beforehand Hope it helps :)
@@navarone77 thank you very much for your response, but I have problem when using onclick event. It won't give appropriate drop down menu every time ,so my button is not triggered
@@weiruowei4576 wdym by "the appropriate dropdown" are you talking about the onclick event?have you dragged in the OnClick event the component/script that is on the gameobject ? make sure its not the one from the Project View
would you mind including this in your next video ? ugs/manual/authentication/manual/best-practices this includes first time user experience which i am struggling right now. i want a anonymous login in the background and a check for cached user and then later offer the player a UI popup with the offer of linking with an actual google or apple account
Prefect timing! I am actually working on a series on this Unity system, that also includes doing Player Profiles, chat features and also game avatars ofc :) I'll be sure to drop the video with your suggestions first, thanks for reminder! if you haven't already, don't forget to subscribe and stay tuned
@@navarone77 hey I love your tutorials and I am really looking forward to this specific topic. Please keep us updated. I have liked and subscribed with notifications on!
good question, I will look into this again tomorrow for sure and will get back at you with an answer. Did you try the AuthenticationService class Logout method already? iirc that should delete any previous tokens, will verify how it is on browser thought to be sure.
@@navarone77 I tried AuthenticationService.Instance.SignOut(true); but seem the player haven't acutally signed out "PlayerAccountsException: Player is already signed in. Unity.Services.Authentication.PlayerAccounts.PlayerAccountServiceInternal.StartSignInAsync (System.Boolean isSigningUp) (at ./Library/PackageCache/com.unity.services.authentication@3.3.1/Player Accounts/Runtime/PlayerAccountServiceInternal.cs:60)"
I'm not entirely sure how they handle the data in UGS, look into their PrivacyPolicy/TOS. Likely they only have access to the same public info you do, nothing private.
Hi nice tutorial, Is there any way to have multi login methods for Google Apple and custom login, also in that case how the auto login will check in terms of scripting, eg a user has apple login, if google play login fails in auth then how it will come to apple login and check via scripting. on the login screen we have 3 ways to login that is google apple & custom email login
Do you mean separately ? Google play by the way is a separate auth , this one is the Unity Player Login should cover all those mentioned already in vid. The Player Login method only waits for the token once logged in. Would you mind explaining the use case of what you're doing this for?
I feel thank you for making this VDO a bit But!!! why do you add functions to Buttons by scripts? this is you are making a Tutorial VDO, and your typing is also very difficult to follow something should add first, But you add last, it so wiered and it not makesense at all!
Thank you for the feedback, I'll certainly make note of your suggestion about the order of elements in the video. Is there a specific part this occurs? I'll review and adjust accordingly for future content. Regarding the buttons,assigning them in code for better clarity. It's definitely helpful to have all references visible in the code editor for easier management and understanding what is linked to what without going through inspector or unity Editor every time. Thanks again for your insights!
Why did you not upload the code? At least write it in the description or as a comment. Without comment and then also sped up. Not really as helpfull as I had hoped...
@@navarone77bro pls reply. So,If we use this login system,this can save the in-game data for each account for example,the level of player or something they have collected?And once they logout and then login again ,may the data be saved for that account.?
@@AsTrO-zq1kz That is correct, this allows to store data for each one of those player accounts via Unity Cloud Save. I have an intro video on intro to Cloud Save , working on a series to do dashboard for players to manage their own data. Subscribe to stay tuned, should be dropping in a few weeks
AuthenticationService.Instance.SignOut will sign out, you can pass a bool to clear credentials. Docs: docs.unity.com/ugs/en-us/packages/com.unity.services.authentication/2.6/api/Unity.Services.Authentication.IAuthenticationService#Unity_Services_Authentication_IAuthenticationService_SignOut_System_Boolean_
The account is already a registered account by using the other providers, you can also sign up with email and password. It takes care of registration for you
nevermind i found the issue the code is not the problem during that setup phase in the unit dashboard i only selected ios/android but not PC. but if you dont select PC then testing on PC in the editor doesnt work. please continue this series its really helpful :-)
Interesting find
Good to know this for future, glad you got it all sorted!
Happy Coding :)
Thank you brother, was about to post something about it. then I read your comment and face palmed myself so hard XD.
Thank you very much! great tutorial!
One question though - can you think of a way to keep the player logged in even after he quit the application?
Do you mean on the mobile device ?
Excellent video, could you make one using Play Games as a Provider? I saw that there are several options besides this one, but I couldn't adjust the code to use with Play Games... Thanks!
hey the code is great but you have to login every time you launch the app can you help me with the issue
You can make a system easily, after you login , you can use the method for detecting already cached player, using the method below
docs.unity.com/ugs/en-us/manual/authentication/manual/cached-players
unfortunatly im getting "error_description=The+request+is+missing+a+required+parameter+or+is+using+an+unsupported+parameter."
Hi sorry for late reply, are you still having this issue? I wouldn't mind taking a look into it again, you'd have to provide me more detail on what going on or where is exactly that error appears.
thanks!
Can you please tell how can we make that it will be saved in user like instead of signing in everytime it should be remember me and logout buttons
Master! thanks to your video save my life how about the logout button which can be signout even credentials like session destroy and to able login another account and even the name can be modified/edit. can you make a video? ❤
it really difficult to follow your typing,
some class are missing some class are don't know what namespace you used,
you should add all script to description,
so, people can easily copy them
Sorry you had troubles, not sure classes were missing.
Okay I will add all the scripts to description
It works fine on editor but on phone the app restarts again and goes to he login page...Any solutions
I tested on phone as you see in video and seems to work , would you mind sharing more info on your setup ?
@@navarone77 yes..but let me try one more time...
@@navarone77 one think I want to say that when I click on login it will open a browser and try to login..but when it goes back after login from the browser ...the game will restart ..its seems its not running on background. .any solution ?
@@devonn6_ hmm that is strange, something might be wrong with your code I'm thinking. Just tested everything again and seems to work here. Perhaps try it on a brand new project just to test out?
@@navarone77 we need to write code for making our app run on recent background apps?..
did they removed the "unity player accounts" i cant see it in the services ?
Did you install the Authentication package ?
Just tested it on Unity 2023 as well, it is still there in Project Settings after you install Authentication.
@@navarone77 yes i did but player accounts is not showing in services it shows online in the providers.. could it be the unity version issue ? i am using 2022.1.24f1
it shows all the other providers like facebook,google,steam etc..
@@navarone77
@@fastsolution restart the editor, atleast that how i sovle the issue
@@Nounsi_Dev it can only be selected in Unity Cloud and then it reflects automatically in the Authentication tab.
Nice tutorial bro !! Thanks so much !!!
you're welcome :)
thanks for watching!
I did this and it is working. Now, all of the sudden the login when redirects me to unity log in on the browser gives "OOPPS Something is wrong!try to signing in again" Do you know what is happening?
I tried and couldn't get the avatar. Is there any way to get the avatar?
Very interesting question, this might be an upcoming feature unity is implementing, I will look into a way to get this done beforehand though.
thanks!
your login is helpful, but I am not sure how it log out here?
Hi Thanks for watching! to Sign out you can call
AuthenticationService.Instance.SignOut
you can pass a bool in the method to clear credentials / stored session.
Link to Docs:
docs.unity.com/ugs/en-us/packages/com.unity.services.authentication/2.6/api/Unity.Services.Authentication.IAuthenticationService#Unity_Services_Authentication_IAuthenticationService_SignOut_System_Boolean_
You might also need to call
PlayerAccountService.Instance.SignOut();
Beforehand
Hope it helps :)
@@navarone77 thank you very much for your response, but I have problem when using onclick event. It won't give appropriate drop down menu every time ,so my button is not triggered
@@weiruowei4576 wdym by "the appropriate dropdown"
are you talking about the onclick event?have you dragged in the OnClick event the component/script that is on the gameobject ? make sure its not the one from the Project View
would you mind including this in your next video ? ugs/manual/authentication/manual/best-practices this includes first time user experience which i am struggling right now. i want a anonymous login in the background and a check for cached user and then later offer the player a UI popup with the offer of linking with an actual google or apple account
Prefect timing! I am actually working on a series on this Unity system, that also includes doing Player Profiles, chat features and also game avatars ofc :)
I'll be sure to drop the video with your suggestions first, thanks for reminder! if you haven't already, don't forget to subscribe and stay tuned
@@navarone77 hey I love your tutorials and I am really looking forward to this specific topic. Please keep us updated. I have liked and subscribed with notifications on!
how do you log out ? of the account, it alays logs tothe same account on google
good question, I will look into this again tomorrow for sure and will get back at you with an answer.
Did you try the AuthenticationService class Logout method already?
iirc that should delete any previous tokens, will verify how it is on browser thought to be sure.
yes, i found out the solution it works , but the browser keeps remembering the auth@@navarone77
@@navarone77 I tried AuthenticationService.Instance.SignOut(true); but seem the player haven't acutally signed out
"PlayerAccountsException: Player is already signed in. Unity.Services.Authentication.PlayerAccounts.PlayerAccountServiceInternal.StartSignInAsync (System.Boolean isSigningUp) (at ./Library/PackageCache/com.unity.services.authentication@3.3.1/Player Accounts/Runtime/PlayerAccountServiceInternal.cs:60)"
@@navarone77 Could you help us fix this, please?
@@aize7887 hey did you check my previous reply ? There should be a logout method on the AuthenticationService
so only the unity team can see if someone login to your app? like user's name,email and id?
I'm not entirely sure how they handle the data in UGS, look into their PrivacyPolicy/TOS.
Likely they only have access to the same public info you do, nothing private.
i rewatched everything still dont see what i missed is there maybe something set in LoginBtn for events that you didnt show ?
Hey could you provide more details on how and when you get error message ? I'm trying to look into it
Is it possible to block players through this system?
You can disable an account with Player Management system.
@@navarone77how?
@@navarone77hooow?
You delete comment?
@@zarplay.official No I don't think so. It still shows fro me. I said you can disable accounts inside the Player Management system
Hi nice tutorial, Is there any way to have multi login methods for Google Apple and custom login, also in that case how the auto login will check in terms of scripting, eg a user has apple login, if google play login fails in auth then how it will come to apple login and check via scripting. on the login screen we have 3 ways to login that is google apple & custom email login
Do you mean separately ?
Google play by the way is a separate auth , this one is the Unity Player Login should cover all those mentioned already in vid. The Player Login method only waits for the token once logged in.
Would you mind explaining the use case of what you're doing this for?
I feel thank you for making this VDO a bit
But!!!
why do you add functions to Buttons by scripts?
this is you are making a Tutorial VDO,
and your typing is also very difficult to follow
something should add first, But you add last, it so wiered
and it not makesense at all!
Thank you for the feedback, I'll certainly make note of your suggestion about the order of elements in the video. Is there a specific part this occurs?
I'll review and adjust accordingly for future content.
Regarding the buttons,assigning them in code for better clarity. It's definitely helpful to have all references visible in the code editor for easier management and understanding what is linked to what without going through inspector or unity Editor every time. Thanks again for your insights!
Why did you not upload the code? At least write it in the description or as a comment. Without comment and then also sped up. Not really as helpfull as I had hoped...
It's pretty straight forward, but I can see how it can be useful to have source code. I will do so in the next videos.
Appreciate the Feedback
@@navarone77bro pls reply. So,If we use this login system,this can save the in-game data for each account for example,the level of player or something they have collected?And once they logout and then login again ,may the data be saved for that account.?
@@AsTrO-zq1kz yes, but you use learn how to read and write to the database
@@AsTrO-zq1kz That is correct, this allows to store data for each one of those player accounts via Unity Cloud Save.
I have an intro video on intro to Cloud Save , working on a series to do dashboard for players to manage their own data.
Subscribe to stay tuned, should be dropping in a few weeks
Hey there, I've uploaded the code/project used in the video. Hope it helps
github.com/navarone77/UnityPlayerLogin_Example
how to logout after login?
AuthenticationService.Instance.SignOut
will sign out, you can pass a bool to clear credentials.
Docs:
docs.unity.com/ugs/en-us/packages/com.unity.services.authentication/2.6/api/Unity.Services.Authentication.IAuthenticationService#Unity_Services_Authentication_IAuthenticationService_SignOut_System_Boolean_
Bro thank u for this
you're welcome!
apple?
should work with apple yes, I cannot currently test it without having a apple dev account
And how to register? Or it is in? Sorry for my atrevement but first is register. Please tell me. Thanks.
The account is already a registered account by using the other providers, you can also sign up with email and password. It takes care of registration for you