Troubleshooting
Problems common to all mobile SDKs. Platform specific problems: iOS Troubleshooting, Android Troubleshooting.
Diagnostic steps
When events, contact data or notifications seem to be missing, go through these steps in order.
- Find the contact the device really uses. Read the contact key from the SDK and open that contact in the panel: on iOS
UserSDK.default?.userKey, on AndroidUserCom.default?.userKey. Flutter has no public API for the key: read it from the network traffic, see step 6. - Check how your app identifies contacts. If anything besides the SDK on the device creates or updates the same users (the REST API, an import, another integration), the SDK may be working on a different contact. See Contacts.
- Check that the first ping succeeded before the first event of a fresh installation.
- Check that screens are tracked in code. No SDK tracks screens unless you call it or enable it.
- Check the event names and attribute types against the rules in Events.
- Capture the network traffic to
*.user.comwith a proxy tool, if the steps above do not explain the problem.
Setup
Nothing reaches the panel, the ping fails with 401
No contact is created for the device and no events appear. The ping response is 401 with an invalid token message.
Cause: the SDK does not have a valid Mobile SDK key. Without a successful ping the SDK has no contact, so no events are recorded. Common reasons:
- the app uses the REST API key instead of the Mobile SDK key,
- the Mobile SDK key was regenerated in the panel, so the old key no longer works,
- the key belongs to another workspace than the domain passed to the SDK.
Fix:
- Copy the Mobile SDK key from the panel again. See Setup and Configuration.
- Check that the key and the domain come from the same workspace.
- Read the result of the ping in your app and confirm that it succeeds before you look for events.
Events
Your app sends events, but they are not on the contact
Causes:
- the events are recorded on another contact, because your app identifies users in more than one way,
- events were sent before the first successful ping of a fresh installation,
- the ping fails, for example with 401,
- the contact was deleted or merged in the panel, so the key stored on the device no longer exists,
- the app was switched to another workspace without a reinstall, so it still uses the key from the previous workspace,
- an attribute name is an empty string, which rejects the whole event. On iOS the completion reports
invalidData, on AndroidInvalidData, and nothing is sent.
Fix:
- Open the contact with the key the device reports.
- Identify users only through the SDK on the device.
- Send events only after the first ping succeeds.
- After deleting or merging a test contact, reinstall the app or log out in the app.
- Do not send empty attribute names.
The contact has events, but no screen events
Cause: the SDK does not track screens unless your app calls it or enables automatic tracking. iOS and Android (with UserCom.initialize) have no automatic screen tracking. On Flutter, and on Android with the deprecated UserCom.Builder, it is optional.
Fix: call the screen tracking method of your platform for every screen. Updating the SDK does not change this. See Screen events.
The event is on the timeline, but some attributes are missing
Causes:
- the value type differs from the first value ever sent for that attribute,
- the attribute name contains only emoji, or is empty after removing HTML,
- the attribute name is
timestamp.
Fix:
- Keep one type per attribute name.
- Use plain, stable attribute names. See Event attributes.
One event name never shows up, other events work
Causes:
- the same name was used before with different letter case or separators, for example
Purchaseafterpurchase, - the name contains HTML, or is longer than 255 characters. On iOS the completion reports
invalidName, on AndroidInvalidName, and nothing is sent.
Fix: use one exact spelling for each event name. See Event names.
Events with text typed by users sometimes never arrive
Cause: content that looks like an attack, such as SQL or file path fragments, can be blocked by the firewall. The event is lost after the first attempt.
Fix: avoid sending free text typed by users as event attributes.
Push notifications
A contact gets no push notifications, or another contact gets them
Causes:
- a token belongs to one contact at a time and moves to the contact of the latest ping that sent it,
- a contact with several devices gets push notifications only on the device with a token that sent a ping most recently,
- after logout, the token was not removed from the previous contact,
- on iOS SDK older than 1.3.0, the app moved the token to a new anonymous contact, see Duplicate anonymous contacts from one iOS device.
Fix:
- Pass the token at login together with the contact data.
- Pass the token at logout: on iOS to
logout(fcmToken:_:), on Android tologout(fcmToken). On FlutterlogoutUser()takes no token. - Open the app on the device you test with, so it sends the most recent ping.
Older SDK versions
Duplicate anonymous contacts from one iOS device
A logged in user gets no push notifications or in-app messages, while the app reports no errors and events reach the contact. The panel shows anonymous contacts with the same device model and iOS version as the logged in contact, without events or data, created around the time a push notification or in-app message campaign was sent. The logged in contact has no device with a push token, or a device shown as "None".
Cause: iOS SDK older than 1.3.0. When a silent push (for example an in-app message) woke the app in the background on a locked phone, the SDK could not read the stored contact key. The ping sent then created a new anonymous contact and moved the push token to it. After the phone was unlocked, the app kept using the old key, so push notifications and in-app messages went to the anonymous contact.
Fix: update to iOS SDK 1.3.0. The anonymous contacts created before the update stay in the panel.
FAQ
What if I have two SDK Admin keys in the panel?
Positive User uses both keys to attempt delivery. Make sure every key belongs to a Firebase project that still exists, otherwise deliveries through it fail.
Can one FCM token belong to several contacts?
No. When a ping sends a token that another contact has, the token moves to the contact of that ping. A common case: an anonymous contact registers a token, then logs in, and the token moves to the identified contact.
Contact support
If the problem persists, contact Positive User support through the chat widget in your workspace or on user.com, or your Customer Success Manager. Include the platform and SDK version, the contact key (see Diagnostic steps, step 1), the time of the test, what you expected to see in the panel, and any errors your code received.