The Android SDK can render in-app notifications natively (banner, alert, HTML) and unwrap Spotzee click-tracking URLs so taps in emails open the right screen in your app. Both surfaces flow through delegates and standard Android intent handling.Documentation Index
Fetch the complete documentation index at: https://docs.spotzee.com/llms.txt
Use this file to discover all available pages before exploring further.
In-app notifications
In-app notifications are content campaigns or journey steps that target the user’s open app session, not the OS notification tray. The SDK fetches them, asks your delegate what to do, and renders chosen ones in aDialogFragment.
Wire up the delegate
ImplementInAppDelegate and pass an instance into Spotzee.initialize:
handle. Only override what you need to change.
What each delegate hook does
| Hook | Default | When it fires |
|---|---|---|
autoShow: Boolean | true | Read on Activity resume. When true, the SDK fetches and displays the latest notification automatically. |
useDarkMode: Boolean | false | Read when rendering. Applies dark-mode styling to alert and HTML notifications. |
onNew(notification): InAppDisplayState | SHOW | Per fetched notification. Return SHOW, SKIP (try next), or CONSUME (mark read silently). |
onNotificationShown(notification) | no-op | After the dialog appears. Use for telemetry. |
handle(action, context, notification) | required | When the user dismisses or triggers a custom action from inside the notification HTML. |
onError(error) | no-op | When fetch or render fails. |
Auto-show on Activity resume
The SDK observesProcessLifecycleOwner and fires showLatestNotification the first time an AppCompatActivity resumes after init (when autoShow = true). You don’t need to wire this yourself.
For finer control, set autoShow = false and call analytics.showLatestNotification() from your own UI moment (after sign-in, after the home screen renders) to defer in-app delivery to a calmer surface than launch.
The three content types
contentType | Renders as | Extra fields |
|---|---|---|
BANNER | A small overlay with title + body | custom: Map<String, String>? |
ALERT | A dialog with title, body, optional image | image: String? |
HTML | A full HTML overlay | html: String |
ALERT and HTML, the embedded HTML can call window.trigger({ … }) from JavaScript to invoke your delegate’s handle(action = InAppAction.CUSTOM, context, notification) with the passed payload. Use this for “Buy now” buttons, “Open settings” actions, or anything that needs to bridge the WebView back to native code.
Deeplinks and App Links
Spotzee click-tracks email links by wrapping them in ahttps://<your-tracking-domain>/c?r=<encoded-target-url> URL. The SDK’s getUriRedirect(uri) unwraps the wrapper, registers the click with Spotzee, and returns the unwrapped target URI.
Configure App Links in your manifest
Add anintent-filter to the Activity that should receive Spotzee deeplinks. Use android:autoVerify="true" for App Links so the OS hands the URL straight to your app instead of the browser.
| Setup | android:host |
|---|---|
| Default Spotzee tracking | apix.spotzee.com |
| Custom tracking domain | track.yourcompany.com |
assetlinks.json for your domain must be served from https://<host>/.well-known/assetlinks.json and list your app’s package name and SHA-256 fingerprint. Read Android’s Verify Android App Links guide.
Unwrap on intent delivery
OverrideonNewIntent (or read the intent from onCreate) and pass the URI through analytics.getUriRedirect(uri). The method returns the unwrapped target URI when it recognised the link, or null when it didn’t.
getUriRedirect also fires the click-registration call to Spotzee in the background so analytics on your campaigns stay accurate.
One-shot navigation helper
If you want the SDK to both register the click AND open the unwrapped URL on your behalf, usehandle(uri) instead of getUriRedirect(uri). It returns true when it handled the URL, false when the URL wasn’t a Spotzee tracking link.
handle(uri) opens the redirect via Intent.ACTION_VIEW with FLAG_ACTIVITY_NEW_TASK. Use getUriRedirect instead if you need full control over how the destination opens.
Next steps
Set up push providers
FCM credentials must be configured before pushes deliver.
Configure custom domains
Set up a custom tracking domain to use as your App Links host.