Skip to content

chore: [SDK-5609] standardize push subscription UI in the demo app - #2006

Merged
fadi-george merged 4 commits into
mainfrom
fadi/sdk-5609
Oct 27, 2026
Merged

fadi-george merged 4 commits into
mainfrom
fadi/sdk-5609

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.

react-native_android_01_push_status_subscribed react-native_android_02_push_opted_out_unsubscribed react-native_android_03_language_row_closed react-native_android_04_language_picker_open react-native_android_05_language_spanish_selected react-native_ios_01_push_status_subscribed react-native_ios_02_push_opted_out_unsubscribed react-native_ios_03_language_row_closed react-native_ios_05_language_spanish_selected

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 row 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 by clearing the cached value only, without calling setLanguage, so a user's backend language isn't overwritten.
  • The picker is a small DropdownMenu: a transparent Modal anchored under the row with measureInWindow, right-aligned, capped at 320, and flipping upward near the bottom of the screen. No picker library needed, and each option keeps its test ID.

Testing

Unit testing

No unit tests; demo UI reading existing SDK state.

Manual testing

vp run lint, vp run test (438 passed), vp fmt --check examples, and the demo tsc --noEmit pass. Not yet run on a device or simulator.

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

…e demo

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. Status logic and language list match Android and the other SDK demos.

fadi-george and others added 3 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>
@fadi-george
fadi-george merged commit f4be307 into main Oct 27, 2026
5 checks passed
@fadi-george
fadi-george deleted the fadi/sdk-5609 branch October 27, 2026 23:08
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