Skip to content

Commit d160fe9

Browse files
AR Abdul Azeezcursoragent
andcommitted
fix: [SDK-5335] keep setLanguage("") as the device language reset
Empty language is the only reset path. Null is still rejected. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 8e336d7 commit d160fe9

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

‎com.onesignal.unity.android/Runtime/AndroidUserManager.cs‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,12 @@ public string Language
7676
{
7777
set
7878
{
79-
if (InputGuard.Missing(value, "setLanguage: language")) return;
79+
// Empty string is the reset to the device language. Null is not.
80+
if (value == null)
81+
{
82+
Debug.LogError("OneSignal: setLanguage: language is required");
83+
return;
84+
}
8085
_user.Call("setLanguage", value);
8186
}
8287
}

‎com.onesignal.unity.ios/Runtime/iOSUserManager.cs‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,12 @@ public string Language
128128
{
129129
set
130130
{
131-
if (InputGuard.Missing(value, "setLanguage: language")) return;
131+
// Empty string is the reset to the device language. Null is not.
132+
if (value == null)
133+
{
134+
Debug.LogError("OneSignal: setLanguage: language is required");
135+
return;
136+
}
132137
_oneSignalUserSetLanguage(value);
133138
}
134139
}

0 commit comments

Comments
 (0)