#LoadServerCredentials with additional scopes

1 messages · Page 1 of 1 (latest)

versed rose
#

Hello I am trying to use GameServices.LoadServerCredentials with additional scopes as I would like to grab the users google id (not GPGS Id) when tossed to the server. Aiming to have users be able to link their data between android and IOS.

When I attempt to follow the documentation/ what is used in the GameServicesDemo.cs with the following script I run into this Issue:

Script:

  {
      ServerCredentialAdditionalScope.OpenId,
      ServerCredentialAdditionalScope.Email,
      ServerCredentialAdditionalScope.Profile
  };

  GameServices.LoadServerCredentials(additionalScopes,(credentialsResult, credentialsError) =>
  {
      if (credentialsError == null)
      {
          //success
      }
      else
      {
          //failure
      }
  });

Error:
2025/09/02 18:08:26.910 2956 2956 Error Unity MissingMethodException: Constructor on type 'VoxelBusters.EssentialKit.GameServicesCore.Android.NativeServerCredentialAdditionalScope' not found.

This error occurs on LoadServerCredentials when requesting any additional scope and ONLY in the android logcat. Nothing in the actual editor.
I have turned "Strip Engine Code" off thinking that may be the issue but still run into this.
I should also mention that using this function without any additional scopes works perfectly fine.

#

Using v3 btw

versed rose
#

Fixed!

Looks like a bug in v3 (or I didn't upgrade correctly). It required some updates to the NativeLoadServerCredentials.cs and GameServicesInterface.cs
In short, the NativeList.cs doesnt take enums so had to change the onSuccessCallback from NativeLoadServerCredentials()

onSuccessCallback = (serverAuthCode, serverCredentialAdditionalScopes) =>
            {
                if (callback != null)
                {
                    ServerCredentials.AndroidPlatformProperties properties = new ServerCredentials.AndroidPlatformProperties(serverAuthCode);
                    ServerCredentials credentials = new ServerCredentials(androidProperties: properties);

                    var convertedScopes = serverCredentialAdditionalScopes
                        .Select(x => (ServerCredentialAdditionalScope)x)
                        .ToList();

                    callback(credentials, convertedScopes, null);
                }
            },
heady ice
#

Yes, you are right. We are on it. Will get you an update with the fix by tomorrow.

#

@dusk tusk Please keep an eye on this thread for the patch.

heady ice