I’ve been trying to use unity’s Authentication services but the Player Accounts Service is not recognized.
I added it via package manager, setup it up via the Unity Services website and made sure it was set up in the project settings but it the namespace is unrecognized in the code.
The Unity.Services.Authentication namespace is recognized but player account Services is not.
Hello @TheGloriousJeb,
I am currently having a look at your issue. Could you please provide a code snippet with the namespace issue for further context ?
Thank you in advance
Sure.
At the start of my code I use the following namespaces:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Unity.Services.Core;
using Unity.Services.Authentication;
using Unity.Services.Authentication.PlayerAccountService ;
using System;
using UnityEngine.SceneManagement;
On line 6, it does not recognize Unity.Services.Authentication.PlayerAccountService
I also have this code which is also does not recognize
PlayerAccountService.Instance.SignedIn += SignInWithUnity;
I’m following tutorials and in those tutorials this works fine.
Thank you for sharing this.
Looking at it, I think the issue comes from the import. I believe it should be using Unity.Services.Authentication.PlayerAccounts;
, instead of using Unity.Services.Authentication.PlayerAccountService;
.
I was able to call PlayerAccountService.Instance.SignedIn
with the above import (with the Authentication SDK v3.3.3
).
You said that you are following a tutorial. Could you share the Authentication SDK version you are using and the link to the tutorial please?
Hi, thanks for the reply.
using Unity.Services.Authentication.PlayerAccounts;
Also is not recognized.
The tutorial:
Unity Player Accounts : Multi-Platform Auth Login (Google, Apple, Email & More!) in 9 Easy Minutes
The Authentication version is 2.7.4 and it claims to be updated.
I’m using Unity 2022.3.56f1 if it makes a difference
Thank you for the additional details. I will have a look and will come back to you as soon as I can.
I’ve found an option to upgrade to version 3.4, it now recognizes that namespace.
Thank you.