Skip to content

chore: [SDK-5607] show push subscription status in the demo app - #1783

Open
fadi-george wants to merge 1 commit into
mainfrom
fadi/sdk-5607
Open

fadi-george wants to merge 1 commit into
mainfrom
fadi/sdk-5607

Conversation

@fadi-george

Copy link
Copy Markdown
Collaborator

Description

One Line Summary

Show push subscription status in the demo app and rename the push toggle to "Opted In".

Details

Motivation

The demo only showed an "Enabled" toggle, so it was hard to tell whether the device actually had a token and permission. 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. The language picker already existed.

  • 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.

Testing

Unit testing

No unit tests; demo UI reading existing SDK state.

Manual testing

Demo builds for the iOS simulator (xcodebuild -scheme App). swiftlint shows only warnings that were already there. 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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant