Repository navigation
fix: [SDK-5608] reset language with '' on Android and standardize demo push UI - #1194
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ndroid The Android bridge turned '' into null, which the native non-null setLanguage rejects. Pass it through so the native SDK resolves the device language, matching iOS and the documented Dart behavior. The demos now send '' for Device Default. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
abdulraqeeb33
approved these changes
Oct 27, 2026
abdulraqeeb33
left a comment
Contributor
There was a problem hiding this comment.
Bridge fix checks out: native core 5.10.1+ resolves '' to the device language and the plugin pins 5.10.2. Demo changes match the other SDKs.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
One Line Summary
Fix
setLanguage('')on Android so it resets to the device language, and standardize the demo push UI.Details
Motivation
The Android bridge turned
''intonull, but nativesetLanguage(value: String)rejects null, sosetLanguage('')likely crashed with a NullPointerException instead of resetting to the device language as the Dart docs say. iOS already passed''through. The demos need this for their Device Default language option. Part of SDK-5300 (standardize push subscription UI across SDK demo apps). Matches the Android demo (OneSignal/OneSignal-Android-SDK#2760).Scope
SDK fix:
OneSignalUser.javapasses''through to native. Native Android has resolved''to the device language since 5.10.1; this plugin ships 5.10.2. No other bridge behavior changes.Demo (
examples/demoandexamples/demo-pods):push_subscription_status, same as Android.user_language_dropdown). It callssetLanguage(code), and Device Default sends'', which the native SDK resolves to the device language. The choice is saved only so the picker shows it after a restart; it is not re-sent at launch, since native keeps its own value. Logout resets it to Device Default, as Android and iOS do.Testing
Unit testing
Root
flutter test: 272 passed, coverage 98.2%. No new Dart test: the Dart side was already correct and the bug was in the Java bridge, which has no unit test harness.Manual testing
flutter analyze(root clean; demos only show 2 warnings that were already there), Java spotless check passes, and theexamples/demodebug APK builds. Not yet run on a device or simulator.Affected code checklist
Checklist
Overview
Testing
Final pass
🤖 Generated with Claude Code