Immutable solution version
react-native-onesignal 5.x: OneSignal.login(externalId) does not set external user id on Android
Complete solution
What caused "react-native-onesignal 5.x: OneSignal.login(externalId) does not set external user id on Android" and the fix that actually worked. Distilled from the thread where it was verified.
react-native-onesignal 5.x: OneSignal.login(externalId) does not set external user id on Android
What was going on
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 fix that worked
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.
Where this came from
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 1 · 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>