Skip to content

[Bug]: OneSignal.User.setLanguage() Not Updating User Language – Notifications Always Sent in Default Language (en) #1021

Open
@mohamedzakaria974

Description

@mohamedzakaria974

What happened?

Calling OneSignal.User.setLanguage("en" | "ar") does not update the user's language on OneSignal. Despite setting the language dynamically based on app language changes, push notifications are always received in the default language (en), regardless of the selected app language.

Expected behavior:

When OneSignal.User.setLanguage(languageCode) is called, the user's language preference should be updated on OneSignal's backend, and notifications should be delivered in the appropriate language (en or ar), based on what was set.

Actual behavior:

Language remains en for the user in OneSignal dashboard.

Notifications always arrive in en, even after setting the language to ar.

This behavior was working previously but has stopped updating recently.

Additional context:

SDK version: onesignal_flutter: 5.3.0

Notification sending method: Using backend via OneSignal REST API (https://onesignal.com/api/v1/notifications)

Devices tested: Multiple real devices, simulators, and emulators

Issue affects: Both iOS and Android

Dashboard observation: Language field in the OneSignal user record no longer reflects recent updates from setLanguage.

Steps to reproduce?

1. Initialize OneSignal in a Flutter app.
2. Change app language and call await OneSignal.User.setLanguage("ar").
3. Send multilingual notification using OneSignal REST API:

{
  "headings": {
    "en": "Title",
    "ar": "العنوان"
  },
  "contents": {
    "en": "content",
    "ar": "المحتوي"
  },
  ...
}

4. Receive notification in default language (en) even though the app was set to Arabic.

What did you expect to happen?

When OneSignal.User.setLanguage(languageCode) is called, the user's language preference should be updated on OneSignal's backend, and notifications should be delivered in the appropriate language (en or ar), based on what was set.

OneSignal Flutter SDK version

5.3.0

Which platform(s) are affected?

  • iOS
  • Android

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions