Back to all

Android: OneSignal plugin is not able to login with a different `external_id` if it was originally given an `external_id` > 128 characters

This bug prevents Android apps using the OneSignal plugin from being able to change the external_id to a correct value that OneSignal will pick up, and the only current solution is to uninstall and reinstall the app entirely to get a new OneSignal user ID


Android reproduction steps:

Failure caused by being "preloaded" with an overflowing external ID

  1. Delete any existing installation of the Android app to get a fresh OneSignal ID
  2. Sign in as user_1 with an external_id (eg: user_1.external_id) that is > 128 characters
  3. Observe that the median.onesignal.info().externalId is the user_1.external_id
  4. Observe that the OneSignal subscription is tied to a user that does not have an external_id
  5. Sign out of user_1
  6. Sign in as user_2 with an external_id (eg: user_2.external_id) that is < 128 characters
  7. Observe that the median.onesignal.info().externalId is the user_2.external_id
  8. Observe that the OneSignal subscription is still tied to a user that does not have an external_id

Success when the "preloaded" external ID is within bounds

  1. Delete any existing installation of the Android app to get a fresh OneSignal ID
  2. Sign in as user_1 with an external_id that is < 128 characters
  3. Observe that the median.onesignal.info().externalId is the user_1.external_id
  4. Observe that the OneSignal subscription is tied to a user with an external_id that is the user_1.external_id
  5. Sign out
  6. Observe that the median.onesignal.info().externalId is empty
  7. Observe that the OneSignal subscription is tied to a user without an external_id
  8. Sign back in
  9. Observe that the median.onesignal.info().externalId is the user_1.external_id
  10. Observe that the OneSignal subscription is tied to the existing user with an external_id that is the user_1.external_id
  11. Sign out of user_1
  12. Sign in as user_2 with an external_id (eg: user_2.external_id) that is < 128 characters
  13. Observe that the median.onesignal.info().externalId is the user_2.external_id
  14. Observe that the OneSignal subscription is tied to a new user with an external_id that is the user_2.external_id