Skip to content

chore: [SDK-5525] add log view to iOS demo app - #1781

Merged
fadi-george merged 3 commits into
mainfrom
fadi/sdk-5525
Oct 21, 2026
Merged

fadi-george merged 3 commits into
mainfrom
fadi/sdk-5525

Conversation

@fadi-george

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

Copy link
Copy Markdown
Collaborator

Description

One Line Summary

Add the shared Log View to the iOS demo app so the Appium suite can assert SDK listener events.
Screenshot 2026-10-21 at 3 35 23 PM

Details

Motivation

sdk-shared/demo/build.md (Prompt 1.5, 2.0, 6.2) adds a logcat-style Log View that the shared Appium suite reads. Without it, iOS skips the notification click and foreground display log assertions. Matches the Capacitor and Android demos.

Scope

  • LogService: same API as Capacitor's LogService.ts. info writes to the console only, show writes to the console and the Log View, error writes to stderr and the Log View. Entries are in memory only (max 100) and appended on main, so it's safe from SDK listener threads. Existing [OneSignal] prints now go through info.
  • LogView: pinned under the nav bar above main_scroll_view, styled per styles.md. Uses log_view, log_entry_{index}, log_clear_button, log_toggle_button.
  • Entries use a non-lazy VStack and collapse shrinks the body to 0 height, so every entry stays in the accessibility tree (spec item 4). Android removes the body instead because of a UiAutomator limitation.
  • Notification, IAM, push subscription, permission, and user observers now log the exact messages from build.md.
  • Demo app only, no SDK changes.

Testing

Manual testing

iPhone 17 simulator, iOS 26.5:

  • run-local --sdk=ios --platform=ios --spec=02: 3 passing
  • run-local --sdk=ios --platform=ios --spec=13: 2 passing. Results show log_view found and log_entry_* queried, so the log assertions ran rather than skipped.
  • Visually checked the panel against styles.md.

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
    • Covered by the shared Appium suite (specs 02, 13)
  • 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

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fadi-george
fadi-george requested a review from nan-li October 21, 2026 22:34
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Multi-model review

Demo-only Log View for the shared Appium suite. Reviewers: Claude Opus 5.5, GPT 5.6 Sol, Grok 4.7.

Act on

  • LogService.log always appends via DispatchQueue.main.async, even when already on main. clear() mutates immediately. A same-turn or already-queued log() can reappear after Clear (2/3).

Consider

  • Collapse is a 0-height .clipped() ScrollView. Rows are created, but XCUITest/WDA often drop zero-rect children — spec item 4 may not hold while collapsed (2/3). Specs 02/13 never tap log_toggle_button.
  • log_entry_{index} is positional. After the 100-entry cap every id shifts; only a few 8pt lines fit in the 100pt viewport, so older entries can also fall out of a clipped snapshot (2/3; same class of issue as the Android demo).
  • LogView adds a second ScrollView above main_scroll_view. A helper that grabs the first scroll view by type (not id) will hit the log panel (1/3).
  • LogService uses ObservableObject / @Published with only import Foundation. Sibling demo types import Combine — confirm this still typechecks (1/3).

Noted

  • project.pbxproj rewrites unrelated TEMP_* Build.xcconfig ids (2/3).
  • Local examples/demo/build.md does not mention LogService / LogView (1/3).
  • Accessibility labels include HH:mm:ss, so exact-match on the message text will fail (1/3).

Dismissed

  • DateFormatter thread-safety (string(from:) is documented thread-safe on iOS 7+).
  • One-argument onChange vs deployment target 16.
  • Observer strings / → / … / IAM messageId — checked against sdk-shared/demo/build.md.
Open in Web View Automation 

Sent by Cursor Automation: PR Reviews

Comment thread examples/demo/App/Services/LogService.swift
Comment thread examples/demo/App/Views/Components/LogView.swift

@nan-li nan-li 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.

Ok to approve with just one question on testing. The test section says specs 02 and 13. Did you also run spec 01?

Append inline when already on main so a queued append can't land after
clear(). Also restore main's XcodeGen TEMP ids in the pbxproj.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fadi-george

fadi-george commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator Author

Ok to approve with just one question on testing. The test section says specs 02 and 13. Did you also run spec 01?

Those are the only 2 that matter. But I did rerun the whole thing and everything passed

@fadi-george
fadi-george requested a review from nan-li October 21, 2026 23:36
@fadi-george fadi-george changed the title feat: [SDK-5525] add log view to iOS demo app chore: [SDK-5525] add log view to iOS demo app Oct 21, 2026
@fadi-george
fadi-george merged commit 623f5a0 into main Oct 21, 2026
7 of 8 checks passed
@fadi-george
fadi-george deleted the fadi/sdk-5525 branch October 21, 2026 23:59
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