Skip to content

chore: [SDK-5613] standardize push subscription UI in the demo app - #906

Merged
fadi-george merged 6 commits into
mainfrom
fadi/sdk-5613
Oct 28, 2026
Merged

fadi-george merged 6 commits into
mainfrom
fadi/sdk-5613

Conversation

@fadi-george

@fadi-george fadi-george commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Description

One Line Summary

Standardize the demo push subscription UI and add a language selector.

unity_android_01_push_subscribed unity_android_02_push_unsubscribed unity_android_03_language_row unity_android_04_language_picker unity_android_05_language_spanish unity_android_05a_language_menu_spanish unity_android_06_language_reset_default unity_ios_01_push_subscribed unity_ios_02_push_unsubscribed unity_ios_03_language_row unity_ios_04_language_picker unity_ios_05_language_spanish unity_ios_05a_language_menu_spanish unity_ios_06_language_reset_default

Details

Motivation

Part of SDK-5300 (standardize push subscription UI across SDK demo apps). Matches the Android demo (OneSignal/OneSignal-Android-SDK#2760).

Scope

Demo app only (examples/demo). SDK unchanged.

  • Push section: new read-only Status row above the toggle. It shows Subscribed only when the user is opted in, notification permission is granted, and a push token is present; otherwise Unsubscribed. It updates from the existing subscription and permission observers, and the push token is now tracked too.
  • The toggle label changes from "Enabled" to Opted In. The existing test ID is unchanged, so Appium selectors still work. The status value label uses push_subscription_status, same as Android.
  • User section: new Language row after External ID with Device Default plus the same 43 languages, in the same order, as Android and iOS (user_language_dropdown). It calls setLanguage(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. Login and logout reset the picker to Device Default locally without calling setLanguage, so the user's backend language isn't overwritten.
  • The picker is a code-built UI Toolkit menu (DropdownMenuDialog) anchored under the language row, rather than Unity's dropdown, whose menu items aren't visible to the demo's Appium tap handling. It matches the other demos: 240 wide, capped at 320 tall, flips upward when there's no room below, scrolls to the current choice, and closes on a tap outside. Options use language_option_<code> (language_option_default for Device Default).

Testing

Unit testing

No unit tests; demo UI reading existing SDK state.

Manual testing

csharpier check . and validate-unity-distribution.py pass. Built with Unity 6000.4 and run on an Android 17 emulator and an iOS 26.5 simulator: menu opens downward and upward, selection updates the row and calls setLanguage, tap outside dismisses without hitting controls underneath, a drag that ends on an item doesn't select it, and reopening centers on the current choice.

Affected code checklist

  • Notifications
    • Display
    • Open
    • Push Processing
    • Confirm Deliveries
  • Outcomes
  • Sessions
  • In-App Messaging
  • REST API requests
  • Public API changes

Checklist

Overview

  • I have filled out all REQUIRED sections above
  • PR does one thing
    • If it is hard to explain how any codes changes are related to each other then it most likely needs to be more than one PR
  • Any Public API changes are explained in the PR details and conform to existing APIs

Testing

  • I have included test coverage for these changes, or explained why they are not needed
  • All automated tests pass, or I explained why that is not possible
  • I have personally tested this on my device, or explained why that is not possible

Final pass

  • Code is as readable as possible.
    • Simplify with less code, followed by splitting up code into well named functions and variables, followed by adding comments to the code.
  • I have reviewed this PR myself, ensuring it meets each checklist item
    • WIP (Work In Progress) is ok, but explain what is still in progress and what you would like feedback on. Start the PR title with "WIP" to indicate this.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fadi-george
fadi-george requested a review from a team as a code owner October 27, 2026 02:53

@abdulraqeeb33 abdulraqeeb33 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, one non-blocking note inline.

fadi-george and others added 5 commits October 27, 2026 13:16
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…etLanguage

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fadi-george
fadi-george merged commit 5302289 into main Oct 28, 2026
1 check passed
@fadi-george
fadi-george deleted the fadi/sdk-5613 branch October 28, 2026 01:09
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

Successfully merging this pull request may close these issues.

2 participants