Interface IQueryStringProvider
Interface for providing dynamic query string values at runtime.
public interface IQueryStringProvider
Examples
Example implementation:
public class RandomQueryProvider : MonoBehaviour, IQueryStringProvider
{
private readonly string[] queries = new[]{ "abc123", "xyz123", };
public string GetQueryString()
{
int index = UnityEngine.Random.Range(0, queries.Length);
return queries[index];
}
}
This would result in a URL like: https://example.com/api/data?userId=abc123
assuming the query key was set to "userId" and the provider returned "abc123".
Remarks
Implement this interface on a component or scriptable object to return a runtime-resolved value for use in a query string. This allows query parameters to be driven by dynamic game state, configuration, or user interaction.
When used with systems that build URLs—such as network requests or telemetry endpoints—
the returned value will be inserted as the value of a specific query string key.
This is typically managed through a QueryStringContainer where the type is set to
QueryStringProvider.