# Troubleshooting

> Symptoms, causes and fixes for the problems teams hit most often with the Herald SDK, from rejected batches to messages that never show.

Find the symptom, check the cause, apply the fix. Turn on debug logging first: most causes leave a line in the log. See [Logging and debugging](/docs/operations/logging-and-debugging).

## Data and identity

| Symptom | Cause | Fix |
|---|---|---|
| Log shows `Herald rejected the app key: check the publishable key in configure` and nothing reaches Herald | The app key is wrong, or the connection is not active | Copy the key again from the connection's **Mobile SDK** card and check the connection is active. The SDK keeps the events and sends them on the next launch with the right key. |
| 401 only for signed-in users | Verification is **Required** and the user token is missing or wrong | Mint the token on your backend from the exact External ID you pass to `identify`. Call `setUserToken` right after `identify`. |
| 401 for every signed-in user after a change on the connection | Someone rotated the ingest token, which invalidates every user token | Re-mint tokens with the new ingest token and deliver them to the apps |
| One message sync 401 right after sign-in, then cards appear | `identify` fetched messages before `setUserToken` ran, under **Required** verification | Harmless. Call `setUserToken` immediately after `identify`; it fetches again with the token. |
| A session-start in-app message does not show in the first session after sign-in | The session-start trigger ran before the token-authenticated fetch returned the message | Expected; it can show from the next session. |
| The user's profile in Herald stays empty | Verification is **Optional** and the batch had no token, so it was stored as anonymous | Call `setUserToken` after `identify` |
| `... ignored: ...` in the log | The call broke a limit, such as an empty event name or a 201-character External ID | Fix the call. See [Limits](/docs/reference/limits). |
| Email or phone not stored | The value failed the check and that key was dropped (`$email is not a valid email`) | Send a valid address, and phone numbers in E.164 (`+15551234567`) |
| Nothing is sent at all | `configure` never ran, or the SDK is disabled | Call `configure` at launch. After `wipeData()`, the SDK stays off until `setEnabled(true)`. |
| Calls made at startup are missing | More than 1,000 calls ran before `configure` | Call `configure` earlier, before other SDK calls |
| `Event queue full: dropped N oldest event(s)` | Uploads failed for a long time, or a call runs in a tight loop | Check the network and the batch status; remove the loop |

## Content cards and in-app messages

| Symptom | Cause | Fix |
|---|---|---|
| No cards or in-app messages | The device is anonymous or unverified, so the fetch returns empty lists | Identify the user and set a valid user token |
| An agent send produced no card for the user | The user had no SDK device on that connection at send time, so the send was suppressed | Make sure the user has opened the app with the SDK at least once, then send again |
| A new card appears only after a restart | Cards are fetched at session start and after sign-in | Call `refreshContentCards()` when the user opens your inbox |
| In-app messages never show | No presenter is installed (`not shown (no presenter or no active scene)` on iOS) | Call `Herald.useDefaultInAppUI()` (iOS) or `HeraldInAppPresenter.install()` (Android) after `configure` |
| A message showed once and never again | Its re-eligibility is `once`. History is kept per user on the device, across restarts and sign-outs. | Expected. `wipeData()` clears the history on a test device. |
| A message shows later than its trigger | Another message was up, the 30-second minimum interval had not passed, or the delegate answered later | Expected: pending messages show when they can. Lower `inAppMinimumInterval` in development if needed. |
| The iOS delegate is never called | The SDK holds the delegate weakly and it was released | Keep a strong reference to your delegate object |
| No in-app messages in one Android screen | The activity is not a `ComponentActivity` | Extend `ComponentActivity` or `AppCompatActivity` |

## Push

| Symptom | Cause | Fix |
|---|---|---|
| No push token stored for the user | Tokens are stored only for identified, verified users | Identify the user and set the user token; the SDK sends the token again after `identify` |
| iOS push fails with `DeviceTokenNotForTopic` | The bundle ID on the connection differs from the app's | Fix the bundle ID in the connection's APNs settings |
| Android: `Firebase is not initialized; push token not synced` | `google-services.json` is missing or the Google services plugin is not applied | Add both, then rebuild |
| Taps do not log opens or open deep links (iOS) | `handleNotificationResponse` is not called, or the notification center delegate is not set | Set `UNUserNotificationCenter.current().delegate` at launch and forward `didReceive` |
| Taps do not log opens (Android) | `handleNotificationIntent` is missing from `onCreate` or `onNewIntent` of the launcher activity | Call it in both |
| Deep link does nothing on Android (`openUrl failed`) | No activity has an intent filter for the scheme | Add the intent filter |
| No image on iOS | No Notification Service Extension, or the image is not HTTPS, is over 10 MB or is not JPEG, PNG, GIF or HEIC | Add the extension with `HeraldNotificationService`; serve a supported image over HTTPS |
| Push still arrives after sign-out | The anonymous batch that unbinds the device has not reached Herald yet | Call `flush()` after `reset()` if the app may close right away |
| No action buttons on pushes from Herald | The variant has no action buttons, the iOS extension is missing, or `herald-fcm` is not in the Android app | Add buttons in **Delivery options (mobile SDK)** and check the platform setup. See [Rich push](/docs/push-notifications/rich-push#action-buttons). |
| New cards and messages wait for the next session | The sync push is not handled, or was sent in the last five minutes | Turn on the Remote notifications background mode and forward the push on iOS. See [Silent push](/docs/push-notifications/silent-push). |

## Still stuck

Collect the SDK version, platform and OS version, the debug log from app launch to the problem, and the User ID (shown to your users as Support ID) or the External ID, and the time of a failing call. Then contact your account team. See [Versioning and support](/docs/operations/versioning-and-support).

## Related

- [Error codes](/docs/reference/error-codes)
- [Logging and debugging](/docs/operations/logging-and-debugging)
- [Testing push](/docs/push-notifications/testing)
