You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: In-app message language variant matching fails for zh-Hans / zh-Hant (falls back to default/English) #1741
In-app messages with language-specific variants for Chinese (zh-Hans / zh-Hant) never match and always fall back to the default variant, even when OneSignal.User.setLanguage("zh-Hans") (or "zh-Hant") is called explicitly and the User's language property is confirmed correct on the dashboard.
Root cause:
In OSInAppMessageController.m (verified in the 5.2.15 tag), the variantId category method on OSInAppMessageInternal does:
then looks up self.variants[type][userLanguageCode]. Truncating to the first two characters is correct for tags like en-US → en, but Chinese variant keys are the full BCP-47 tags zh-Hans and zh-Hant per your own supported languages list — both truncate to "zh", which matches neither key, so the lookup falls through to variants[type][@"default"].
Steps to reproduce?
1.On react-native-onesignal 5.2.15 (OneSignalXCFramework 5.2.15), create an in-app message in the dashboard with language variants for zh-Hans (or zh-Hant) and a default variant with different content.
2.In the app, call OneSignal.User.setLanguage("zh-Hans") before the message is expected to trigger.
3.Confirm on the dashboard/User record that the language is correctly stored as zh-Hans.
4.Trigger the in-app message on iOS.
5.For comparison: the equivalent Android app (same OneSignal setup, same language) correctly shows the zh-Hans variant.
What did you expect to happen?
Expected: The zh-Hans variant content is shown.
Actual: The default variant content is shown (in our case, English). Android is unaffected.
@fadi-george Any update on this, as I got no response from the support team from last 2 days and we don't want to add any patch on our side. Can you give me estimated time.
Activity
fadi-george commentedon Sep 14, 2026
Thanks for the report, we'll take a look.
fadi-george commentedon Sep 14, 2026
@luckychdhr could you reach out to our support team and give us your app id? Mention "SDK-5202".
luckychdhr commentedon Sep 14, 2026
@fadi-george Sure, I will do that. No worries.
luckychdhr commentedon Sep 16, 2026
@fadi-george Any update on this, as I got no response from the support team from last 2 days and we don't want to add any patch on our side. Can you give me estimated time.
fadi-george commentedon Sep 16, 2026
@luckychdhr we'll be looking into long term sdk side fixes. But I believe we've deployed a short-term server side fix for this issue. Could you check?
luckychdhr commentedon Sep 16, 2026
Let me check and get back to you @fadi-george
luckychdhr commentedon Sep 16, 2026
Its working now. Thanks @fadi-george
fadi-george commentedon Sep 16, 2026
@luckychdhr Great!