Skip to content

Push token tracking

Affise accepts push tokens acquired from your platform push provider. The SDK uses these tokens for uninstall tracking and push-related attribution.

public static void AddPushToken(string pushToken, PushTokenService service)

Declared at Runtime/Affise.cs:76.

public enum PushTokenService (Runtime/Settings/PushTokenService.cs:5).

| Value | Wire mapping | Notes | |---|---|---| | FIREBASE | "fms" | Android (Firebase Cloud Messaging) | | APPLE | "apns" | iOS only (APNs) |

Service-name mapping at Runtime/Settings/PushTokenService.cs:13-21. Supported providers per README: APPLE (iOS only), FIREBASE.

Minimal call:

Affise.AddPushToken(token, PushTokenService.FIREBASE);

Forward the Firebase ID token. Verbatim example from:

Firebase.Auth.FirebaseUser user = Firebase.Auth.FirebaseAuth.DefaultInstance.CurrentUser;
user.TokenAsync(true).ContinueWith(task => {
if (task.IsCanceled) {
Debug.LogError("TokenAsync was canceled.");
return;
}
if (task.IsFaulted) {
Debug.LogError("TokenAsync encountered an error: " + task.Exception);
return;
}
string idToken = task.Result;
Affise.AddPushToken(idToken, PushTokenService.FIREBASE);
});

ProviderType.UNINSTALL_TIME exists in the providers map (Runtime/Parameters/ProviderType.cs:36). No Unity public setup API is exposed for enabling uninstall detection explicitly — it relies on the configured push token plus the attribution provider side.