Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

On removing the external user id when user logout from the app. The device status in OneSignal changes to never subscribed, which leads to sending notification fails.(Mobile Application - React Native) #1384

Closed
Chandrakala0702 opened this issue May 4, 2022 · 2 comments
Assignees

Comments

@Chandrakala0702
Copy link

Chandrakala0702 commented May 4, 2022

On user login, call the below method to set the external user-id under the particular device.

let externalUserId = '123456789'; // You will supply the external user id to the OneSignal SDK

// Setting External User Id with Callback Available in SDK Version 3.9.3+
OneSignal.setExternalUserId(externalUserId, (results) => {
  // The results will contain push and email success statuses
  console.log('Results of setting external user id');
  console.log(results);
  
  // Push can be expected in almost every situation with a success status, but
  // as a pre-caution its good to verify it exists
  if (results.push && results.push.success) {
    console.log('Results of setting external user id push status:');
    console.log(results.push.success);
  }
});

On user logout, call the below method to remove the external user-id under the particular device.

OneSignal.removeExternalUserId((results) => {
     // The results will contain push and email success statuses
     console.log('Results of removing external user id');
     console.log(results);
   });

@kesheshyan
Copy link
Contributor

Thanks for reporting, we are looking into this.

@jennantilla
Copy link
Contributor

@Chandrakala0702 apologies that this issue has gone stale. I'll be closing it out due to inactivity, but if you are still having issues please @ mention me and we can pick back up the conversation!

We have released a new User Model major release that offers many improvements and enhancements. I'd highly recommend upgrading to our latest SDK version and checking it out! Please see our migration guide for full details!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants