The setup check
The setup check runs, on the phone, the checks you would otherwise make by hand: that the SDK started, reaches PurrCRM with the right key, signs the user in, sends events, gets pushes and opens links, and that your hooks are wired. It is the one piece of UI the SDK ships, and it is for developers only.
Turn it on
Section titled “Turn it on”CrmConfig( apiBase = "https://app.purrcrm.com", appKey = BuildConfig.CRM_APP_KEY, appVersion = BuildConfig.VERSION_NAME, debug = BuildConfig.DEBUG, pushChannels = listOf("messages"), // your Android channel, for the Channel row)With debug on, the SDK:
- writes every request to the log (Logcat, tag
crm): its method, path, status, request id and time. Never a token, and ids in paths are shortened; - shows the setup check over your app once its first start has answered and an Activity is showing.
With debug off (the default) none of it is made. A release build with debug on writes a warning to the log once per launch: never ship it on.
The panel
Section titled “The panel”The setup check is a bottom sheet drawn over each Activity with Android’s own views: it needs no overlay permission and no AppCompat, and follows the phone’s dark mode. Touches outside it reach your app.
- Each check is a row with a dot: green (OK), amber (a warning), red (a failure), grey (skipped, or the SDK cannot tell). Tap a row for its detail and How to fix.
- Collapse folds it into a small pill in a corner,
CRM ● 14/17(the checks that pass of those run, the dot in the colour of the worst). Drag the pill where it is out of the way; tap it to open the sheet again. - Hide takes it away until the app’s process starts again.
The checks run when the panel first shows, after each test action, and when you press Run checks again. To run them, the setup check makes three requests of its own: your app’s public face, one call as the signed-in user (GET /guest/v1/consent), and your link host’s assetlinks.json.
A row’s fix names the place on PurrCRM to go to, when the fix is there, and the page of these docs that says more, by its title under Android: Docs: Android › Push is Push, and Docs: Android › The setup check, Network is Network below.
The checks
Section titled “The checks”| Check | Not green when | What to do |
|---|---|---|
| Version and kind | Always green: the SDK’s version, as every request says it with its kind (android). | Nothing. |
| Started and ready | Red: start() has not finished 10 seconds after the SDK was made. Amber: started, but setReady(true) not called within 10 seconds, or called later than that (“Ready 14 s after boot”): pushes tapped and links opened wait for it. | Call crm.start() once, in Application.onCreate. Call crm.setReady(true) as soon as sign-in and your first screen are done (Sign users in). |
| Lifecycle followed | Amber: followLifecycle is off, so events are flushed and messages checked in only when you call appPaused() / appResumed(). Red: the SDK was not made with your app’s Context, so it cannot watch your Activities. Green says whether a trip to the background and back has been seen. | Make the Crm with context = this in your Application, and leave followLifecycle on, or call the two yourself. |
| Check | Not green when | What to do |
|---|---|---|
| Server reachable | Red, with how the request failed: TLS failed (the certificate was not trusted), Host not found, Cleartext blocked (Android refuses http:// to that host), No answer in time, Not reached, Answered 5xx, or Answered something that is not the CRM. | Check CrmConfig.apiBase (https://app.purrcrm.com), the phone’s network, and for http to a laptop, the network security config. |
| App key and mode | Red: no app key, or PurrCRM knows no app by this key. Amber: a test key (app_test_…) in a release build. Green shows the mode, live or test. | Copy the key again from the App key card on Settings › your app › Developers › Install. Build what users install with the live key (Test mode). |
| Features | Amber: one of the messenger, the help center or in-app messages is off for the app. Grey until PurrCRM has answered. | Switch on the ones your app uses (Settings › your app › General, Name and features). |
| Check | Not green when | What to do |
|---|---|---|
| Sign-in mode | Amber: unverified, so anyone can be anyone. | Sign users in with tokens from your backend before you ship. |
| Token | It reads the token’s claims, never showing the token. Red: tokens.current() threw (its failure is shown), answered null while a user is signed in, has no sub, or is an HS256 token whose exp is more than 30 days away. Amber: not a JWT the SDK can read (PurrCRM is the judge: see Guest call), no iat, or the phone’s clock looks wrong. Green shows the algorithm and minutes left. Grey while nobody is signed in. | Fix the backend route that signs the token (Sign users in). Set the phone’s time automatically. |
| Guest call | Red: the call as the user was refused (401: Token refused, with PurrCRM‘s sentence and the request id), refused for another reason, or not reached. Grey while nobody is signed in. | Sign with this app’s identity secret, for this mode’s key: a test key needs the test app’s secret (crm_is_test_…). Test a token on Settings › your app › Developers › Sign-in says why a token is refused. |
| Session | Amber: nobody signed in (crm.session(...) has not been given a user). | Call crm.session(CrmSession(guestId)) when the user signs in. |
Events
Section titled “Events”| Check | Not green when | What to do |
|---|---|---|
| Queue | Amber: the last flush failed (how many in a row, the failure, when it tries again), or a batch was refused. Green shows how many are queued and the last flush. | A failure: see Guest call; events are kept and sent later. A refusal: define your own events on Settings › your app › Data › Events and in CrmConfig.customEvents (Events). |
Pushes
Section titled “Pushes”| Check | Not green when | What to do |
|---|---|---|
| Permission | Amber: the app’s notifications are off on this phone. Grey below Android 7.0. | On Android 13 and later, ask for POST_NOTIFICATIONS (Push). |
| Token registered | Amber: registerPushToken has not been called in this run. Red: a user is signed in and PurrCRM has not taken the token. Grey until someone signs in. | Pass Firebase’s token to crm.registerPushToken. A red row: see Guest call. |
| Channel | Amber: a channel is missing. It looks for every channel in CrmConfig.pushChannels, or for messages when you list none: never both. Grey below Android 8.0. | Create the channel your app’s Android channel names as the app starts (Push), and list it in pushChannels when it is not messages. |
| Handler wired | Amber: no push has been handed to handlePushArrival or handlePushTap on this install (data that is no push does not count). | Forward RemoteMessage.data from onMessageReceived, and a tapped notification’s extras (Push). Then press Push my phones under Send a test push on Settings › your app › Delivery › Push. |
| Check | Not green when | What to do |
|---|---|---|
| Link host | Amber: PurrCRM gave no link domain: the app’s links are not turned on, or PurrCRM is older. | Turn links on, on Links › Setup (Links). |
| App Links | Red: assetlinks.json is not served on the link host; it does not name this package; this build’s certificate is not listed (the detail shows this build’s SHA-256 fingerprint, to paste into Android signing SHA-256); or no intent filter of the app takes the link host. Amber: Android has not verified the domain yet (Android 12 and later; it verifies after install, which can take a while, or fail). Grey with no link host, or one that is not https (a laptop cannot serve App Links). | Add the package and the fingerprint on Links › Setup, and the intent filter to your manifest (Links). Reinstall, or re-verify with adb. |
| Declared links | Amber: CrmHost.links is empty, so your team’s link picker offers only PurrCRM‘s own pages. | Declare your places as CrmLinks (Links). |
| Deferred links | Amber: CrmHost.installReferrer is not set, so a link that sent the phone to the store is lost on the first run; or it was set through crm.host after start(), which reads it (set after start()). Green shows the claim: claimed, pending or none. | Wire Play’s Install Referrer library into CrmHost.installReferrer, in the host you make the Crm with (Links). |
| Check | Not green when | What to do |
|---|---|---|
| Navigation hooks | Red: CrmHost.navigate is not set, so tapped pushes, links and crm.open(...) cannot show PurrCRM‘s screens. Amber: openInApp is not set (links to your own places go nowhere), or nothing collects crm.inApp.next (nobody draws in-app messages). | Set navigate and openInApp (Initialise), and collect crm.inApp.next (In-app messages). |
Storage
Section titled “Storage”| Check | Not green when | What to do |
|---|---|---|
| Store works | Red: a probe key could not be written, read back and removed. | Check CrmConfig.store, if you set one. |
Test actions
Section titled “Test actions”Under Test actions, each button says beside it what came of it:
- Run checks again.
- Send a test event: records
screen_viewedfor the screencrm_setup_checkand sends the queue at once. It says whether PurrCRM accepted it, refused it (and why), failed (kept for later), or that nobody is signed in. - Check in now: asks PurrCRM for in-app messages at once (
crm.checkNow()), and says how many test messages came, whether this phone is a test phone, what is next to show, and whether your app observescrm.inApp.next. - Open messenger and Open help center: open them through your
navigatehook, and say whether it answered true. - Copy guest id: puts the signed-in user’s id on the clipboard, to find them on PurrCRM or pick them for a test send.
- Test a push: registers the push token again (shown shortened), then asks you to send a test push from PurrCRM (Push my phones, under Send a test push on Settings › your app › Delivery › Push). For two minutes it watches for a push handed to the SDK, and Handler wired turns green when one arrives.
- Test links: makes a link of the user’s own to
/messages(ascrm.createLinkdoes, so it is counted under Links like any other), and lists its address on the link host, its short/go/address, and a PurrCRM page on your link base. Each has Share (the share sheet, to send it to another phone), Open here (handed tohandleLinkin this app, as if the app had been opened by it) and Open through Android (handed to Android, the way an App Link arrives). - Export report: the report below, through the share sheet.
The report
Section titled “The report”Export report writes the setup check as plain text, for a bug report or a message to your team: when it ran, the SDK’s version, your package and app version, the Android API level, your app key, its mode and whether this is a release build, the count of each colour, every check (with its detail and fix for the amber and red ones), and the request ids of the requests that failed. It never holds a token. It does hold the signed-in user’s id, on the Session row.
Network
Section titled “Network”-
TLS on old Android. Android 5.0 to 7.0 (API 21 to 24) do not trust ISRG Root X1, the root of Let’s Encrypt’s certificates. Below API 25, the SDK’s own connections trust it beside the system’s roots; nothing else changes, and from API 25 the system’s roots are used as they are. Your app’s own connections (an image loader fetching pictures, say) are not covered: if they reach a host on such a certificate and you support those versions, add the root to your app’s network security config.
-
Cleartext for local development only. Android 9 and later refuse
http://unless the app allows that host. To run against a PurrCRM on your laptop (from the emulator it is10.0.2.2), allow cleartext to that host in a debug build only, so a release never can:app/src/debug/res/xml/network_security_config.xml <network-security-config><domain-config cleartextTrafficPermitted="true"><domain includeSubdomains="false">10.0.2.2</domain><domain includeSubdomains="false">localhost</domain></domain-config></network-security-config>app/src/debug/AndroidManifest.xml <manifest xmlns:android="http://schemas.android.com/apk/res/android"><application android:networkSecurityConfig="@xml/network_security_config" /></manifest>What your users install talks to
https://app.purrcrm.comover https. The Server reachable row says Cleartext blocked when this is missing.