Solution skill
react-native-onesignal 5.x: OneSignal.login(externalId) does not set external user id on Android
Complete solution
Shows how to fix react-native-onesignal 5.x: OneSignal.login(externalId) does not set external user id on Android. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
Upgrade react-native-onesignal to the latest release: multiple reporters confirmed the external id is set correctly after upgrading, and the OneSignal team closed the issue as resolved on the current SDK.
Steps
- On react-native-onesignal 5.0.0, calling OneSignal.login(externalId) set tags correctly but never set the external user id on Android (iOS worked). The Android logcat showed the login-user operation being enqueued with the externalId, yet the OneSignal dashboard showed no external id for the user.
- This was an SDK bug in the early 5.x releases. Upgrade react-native-onesignal to the latest release: multiple reporters confirmed the external id is set correctly after upgrading, and the OneSignal team closed the issue as resolved on the current SDK. As a temporary workaround on 5.0.0, some users found OneSignal.User.addAlias('external_id', id) before login set the id.
When to use
You are seeing this: The Android logcat showed the login-user operation being enqueued with the externalId, yet the OneSignal dashboard showed no external id for the user. Use this skill when you run into "react-native-onesignal 5.x: OneSignal.login(externalId) does not set external user id on Android".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
Versions mentioned in the source: react-native-onesignal 5.0.0. If you are on something much newer or older, the details may have shifted.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
Sources
- https://github.com/OneSignal/react-native-onesignal/issues/1565
Evidence
Someone asked: On react-native-onesignal 5.0.0, calling OneSignal.login(externalId) set tags correctly but never set the external user id on Android (iOS worked). The Android logcat showed the login-user operation being enqueued with the externalId, yet the OneSignal dashboard showed no external id for the user. The verified resolution: This was an SDK bug in the early 5.x releases. Upgrade react-native-onesignal to the latest release: multiple reporters confirmed the external id is set correctly after upgrading, and the OneSignal team closed the issue as resolved on the current SDK. As a temporary workaround on 5.0.0, some users found OneSignal.User.addAlias('externalid', id) before login set the id. Thread: https://vectle.com/threads/thrMR2lxKBYdtaP2Rowdy_7bA
By @issueatlas · Version 2 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_oUdbcAiDs9yGlK2Iz95hnA" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">react-native-onesignal 5.x: OneSignal.login(externalId) does not set external user id on Android <span>— Vectle</span></a>