Skip to content

chore: [SDK-5527] add sticky log view to demo app - #2005

Merged
fadi-george merged 4 commits into
mainfrom
fadi/sdk-5527
Oct 16, 2026
Merged

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

Conversation

@fadi-george

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

Copy link
Copy Markdown
Collaborator

Description

One Line Summary

Add a sticky Log View to the React Native demo app so the shared Appium suite can assert on SDK listener events.

Details

Motivation

The shared demo spec (sdk-shared/demo/build.md Prompt 1.5, 2.0, 6.2 and styles.md Log View) requires an on-screen log of SDK events. Without it, the Appium suite skips the JS event assertions in specs 02 and 13 for React Native. This mirrors the Capacitor demo (LogService.ts, LogView.tsx).

Scope

Demo app only (examples/demo). No SDK source changes.

  • LogService.ts: in-memory store (max 100 entries, never persisted) with a single log() helper that appends an entry and writes [OneSignal] {message} to the console.
  • LogView.tsx: dark logcat-style panel pinned under the app bar, outside the main scroll view. Shows LOGS ({count}), a clear button, and a collapse toggle; auto-scrolls to the newest entry. Collapsing sets the body height to 0, so entries stay in the view hierarchy.
  • testIDs: log_view, log_entry_{index}, log_clear_button, log_toggle_button.
  • useOneSignal.ts: IAM, notification click/foregroundWillDisplay, push subscription, permission, and user change listeners all log through log() using the spec's exact message formats. Notification messages now include notificationId.
  • Podfile.lock: pod checksum refresh from pod install.

Testing

Unit testing

None; demo UI only.

Manual testing

Ran the shared Appium suite locally with run-local.sh --sdk=react-native:

  • iOS (iPhone 17 simulator): full suite, 36 passing, including the log assertions in spec 02 and the cold-start and background tap tests in spec 13.
  • Android (Android 16 emulator): full suite, 32 passing, 1 failing. The failure is 13_notification_click "opens the launch URL after a cold-start tap" (Launch URL never opened). It also fails on main without this change, so it is a separate Android cold-start launch URL issue. Local runs bail on first failure, so the Android background-tap test in spec 13 did not run.

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
  • 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.
  • I have reviewed this PR myself, ensuring it meets each checklist item

🤖 Generated with Claude Code

@fadi-george
fadi-george requested a review from a team as a code owner October 13, 2026 23:10

@sherwinski sherwinski 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.

One thing worth checking

Comment thread examples/demo/src/components/LogView.tsx Outdated
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@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, matches the shared Log View spec. A few nits inline, none blocking.

Comment thread examples/demo/ios/Podfile.lock Outdated
Comment thread examples/demo/src/components/LogView.tsx Outdated
Comment thread examples/demo/src/components/LogView.tsx Outdated
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fadi-george
fadi-george merged commit 7a0be86 into main Oct 16, 2026
2 checks passed
@fadi-george
fadi-george deleted the fadi/sdk-5527 branch October 16, 2026 23:18
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.

3 participants