Skip to main content

Configuration

The SDK ships with a GameRebellionSettings ScriptableObject located at Assets/GameRebellion/Resources/GameRebellionSettings.


Required Settings

FieldTypeDescription
EnvironmentenumDevelopment, Staging, or Production

Optional Settings

FieldTypeDefaultDescription
BatchSizeBytesint65536Max batch size in bytes before auto-flush
BatchMaxEventsint100Max events per batch before auto-flush
FlushIntervalMsint30000Time-based flush interval in milliseconds
EnableCompressionbooltrueGzip compress event batches
AutoTrackSessionbooltrueAutomatically send session_start/stop events
TransportTypeenumHTTPTransport protocol for event delivery

Initialization

Initialize the SDK as early as possible — ideally in Awake() of a bootstrap MonoBehaviour in your first scene:

GRBootstrap.cs
using UnityEngine;
using GameRebellionSdk.Unity;

public class GRBootstrap : MonoBehaviour
{
[SerializeField] private string apiKey; // Set via Inspector or env config

private void Awake()
{
bool ok = GameRebellion.Initialize(apiKey);

if (ok)
Debug.Log("GameRebellion SDK ready");
else
Debug.LogError($"GameRebellion init failed: {GameRebellion.GetLastError()}");
}
}

What Happens on Initialize

  1. The SDK loads GameRebellionSettings from your Resources folder.
  2. The native core starts the event pipeline (consent gate → validator → enricher → redactor → batcher → transport).
  3. A hidden GRMetricsCollector GameObject is auto-created. It tracks FPS and memory, and manages app lifecycle (pausing sessions on background, resuming on foreground, shutting down on quit).
  4. If AutoTrackSession is enabled, a session_start event is sent immediately.
note

Shutdown() is handled automatically by GRMetricsCollector when present. If you remove or disable it, you must call GameRebellion.Shutdown() on application quit and manage SetPaused() on app background/foreground transitions yourself.

Platform-Specific Setup

The iOS native adapter requires the following Apple frameworks. Add them in Xcode if the build fails with missing symbols:

  • AdSupport
  • AppTrackingTransparency
  • AdServices
  • CoreTelephony
  • SystemConfiguration

The SDK handles IDFA collection and ATT prompts when consent is granted.