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

[question]: How to force add alias? #737

Closed
1 task done
AFB-MORA opened this issue May 24, 2024 · 3 comments
Closed
1 task done

[question]: How to force add alias? #737

AFB-MORA opened this issue May 24, 2024 · 3 comments

Comments

@AFB-MORA
Copy link

How can we help?

I'm using Unity Authentication with anonymous, and Facebook login options. I'm using Unity player ID for external ID and facebook_id alias. I handle account linking conflicts as in Unity Documentation.

For example, a user logs in with Facebook on device A. Unity ID is UID1, and Facebook ID is FBID. Then the user logs in with Facebook on device B. Unity ID is UID2. I give 2 options: link local game (i.e. force link FBID to UID2 and remove FBID from UID1) or connect the other account (i.e. remove UID2 and connect as UID1). I have a problem with option 1. If the user chooses option 1, OneSignal external ID is set to UID2. But Facebook ID is still linked with UID1. As One Signal documentation says I must call OneSignal.login but I have no way of knowing UID1. Even if I knew UID1, login would be wrong. Because UID1 is another device, and current external ID is UID2. How can I force link FBID to UID2?

Code of Conduct

  • I agree to follow this project's Code of Conduct
@shepherd-l
Copy link
Contributor

shepherd-l commented May 29, 2024

You could use our Server REST API and call Delete Alias: https://documentation.onesignal.com/reference/delete-alias

Let me know if you have any questions

@shepherd-l
Copy link
Contributor

shepherd-l commented May 29, 2024

If you call OneSignal.login again when the "Unity player ID" changes, I don't think it should conflict with the alias of the Facebook Id you are setting then. As for a given "Unity player ID", the Facebook Id should be consistent.

@AFB-MORA
Copy link
Author

Thank you. REST API works like a charm.

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

2 participants