PLEASE im looking for a solution to this for HOURS now.
I imported all Namespaces am i missing some?
Hi,
It looks like you’re trying to get remote-config settings.
- make sure you have the right references if you are using an asmdef.
"Unity.Services.Core",
"Unity.Services.Authentication",
"Unity.Services.RemoteConfig",
- Try the following code:
using System;
using Unity.Services.Authentication;
using Unity.Services.Core;
using Unity.Services.RemoteConfig;
using UnityEngine;
public class ConfigGetter : MonoBehaviour
{
async void Start()
{
RuntimeConfig res;
try
{
// Initialize
await UnityServices.InitializeAsync();
// Sign in
await AuthenticationService.Instance.SignInAnonymouslyAsync();
//Fetch configuration settings from the remote service:
res = await RemoteConfigService.Instance.FetchConfigsAsync(new EmptyStruct(), new EmptyStruct());
Debug.Log(res.config);
}
catch (Exception e)
{
Debug.LogError(e);
Debug.LogError("Failed to fetch configs, is your project linked and configuration deployed?");
}
}
struct EmptyStruct {}
}
This Code works but not mine. I only got a Probleme with the ConfigManager
Hi
Does the code not achieve the intended objective anyway?
I believe the ConfigManager is no longer part of the public API maybe you’ve upgraded the version of the package you’re using.
I can see RemoteConfigService now has those methods.
Cheers.
