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]: Can I have 2 devices with different languages ​​with the same external_id? #1009

Closed
1 task done
fsilvafactoriabiz opened this issue Feb 21, 2025 · 1 comment

Comments

@fsilvafactoriabiz
Copy link

fsilvafactoriabiz commented Feb 21, 2025

Can I have 2 devices with different languages ​​with the same external_id?

For example 1 device with the language in Spanish and another device in the language English

How can I assign the language to the device I have subscribed to? Right now when I use setLanguage the language is set in all subscriptions.

This is my code in flutter (onesignal_flutter: ^5.2.9):

First I do the login with an external id and then I assign the language to it.

var localeName = AppLocalizations.of(context)!.localeName;
OneSignal.login('testExternalId');
OneSignal.User.setLanguage(localeName);

Examples of languages ​​I assign are: 'es' and 'en'

Code of Conduct

  • I agree to follow this project's Code of Conduct
@fsilvafactoriabiz fsilvafactoriabiz changed the title [question]: SetLanguage Subscription [question]: Can I have 2 devices with different languages ​​with the same external_id? Feb 21, 2025
@nan-li
Copy link
Contributor

nan-li commented Feb 27, 2025

Hi @fsilvafactoriabiz thanks for reaching out.

Unfortunately, you cannot set 2 languages for the same user. Language is treated and stored as a user-level property instead of at the device or subscription level. If you have a need for this, I recommend you to try using data tags to meet your needs.

@nan-li nan-li closed this as completed Feb 27, 2025
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