Swan
Properties
Functions
Fire a delivered ACK for a push notification.
Cold-start variant of ackPushDelivered — POST a delivered ACK without requiring init to have run.
Register a callback for the unified DEEP_LINK_OPENED event.
Subscribe to the deviceRegistered lifecycle event.
Subscribe to the deviceRegistrationFailed lifecycle event.
Register a one-shot callback fired when the SDK's background device-registration phase resolves (either RegistrationState.Registered or RegistrationState.Failed).
Subscribe to the networkStateChanged lifecycle event.
Register a callback fired every time the user taps a Swan push notification.
Subscribe to push-permission lifecycle events.
Subscribe to the pushNotificationReceived lifecycle event — fires when a data-only FCM message arrives in the FOREGROUND, BEFORE the SDK posts the system notification.
Subscribe to the pushTokenRefresh lifecycle event — fires on FCM token rotations (FirebaseMessagingService.onNewToken).
Subscribe to the pushTokenRegistered lifecycle event.
Subscribe to the pushTokenRegistrationFailed lifecycle event.
RN-parity alias for track.
Delete a notification channel (Android 8+; no-op on older API levels).
Toggle the SDK's internal debug-log gate at runtime.
Update arbitrary attributes on the user's customer profile.
Update arbitrary attributes on the user's customer profile using a pre-built JsonObject. Skips the Map<String, Any?> → JsonObject conversion.
Read the current app-icon badge count.
Return the current session id, or null if init hasn't been called yet.
Snapshot of the SDK's view of the host device.
Returns the current FCM token, or null if push hasn't been registered yet.
The id of the default Swan notification channel.
Returns the number of pending events in the durable queue.
Returns the current Swan identifier — the logged-in CDID if present, else the anonymous generatedCDID, else null if registration hasn't completed yet.
Handle a deep-link URL from an EXTERNAL source — email, SMS, WhatsApp, Universal Links, custom schemes, ad-network click-throughs.
Test / demo entrypoint exposing handleFcmInbound to the sample app and instrumented tests. Behaves identically to a real FCM-dispatched RemoteMessage arriving via SwanMessagingService.onMessageReceived: the template router resolves NotificationTemplate, the appropriate renderer fires, and the notification is posted.
Cold-start handler — Bundle variant.
Cold-start handler: extract the notification payload from a launch Intent and route it through the SDK.
Deliver a notification tap to the SDK.
Check the current OS notification-permission state.
Snapshot read — is location tracking enabled in the SwanConfig?
Snapshot read — is push enabled in the SwanConfig passed to init?
Snapshot read of the push subsystem state.
Register a host-supplied FCM token with the Swan backend.
Unregister a previously-registered DEEP_LINK_OPENED listener.
Unregister a previously-registered NOTIFICATION_OPENED listener.
Fetch the FCM token via the host's Firebase Messaging SDK and register it with Swan.
Prompt the user for notification permission.
Set the app-icon badge count.
Set the businessUnit super-property.
Set the country super-property. Auto-enriched onto every subsequent event's data.country.
Set the currency super-property.
Register the host Activity backing the notification-permission OS dialog. Call from onResume(); pass null from onDestroy() if you want to be explicit (the SDK uses a java.lang.ref.WeakReference internally so it never prevents the Activity from being GC'd).
Set the current screen name as a super-property.
Revoke the push subscription with the Swan backend.
Update the SDK's view of the device location.