Skip to content

chore: [SDK-5032] enable Mac Catalyst demo builds - #1716

Merged
fadi-george merged 7 commits into
mainfrom
fadi/sdk-5032
Aug 19, 2026
Merged

chore: [SDK-5032] enable Mac Catalyst demo builds#1716
fadi-george merged 7 commits into
mainfrom
fadi/sdk-5032

Conversation

@fadi-george

@fadi-george fadi-george commented Aug 14, 2026

Copy link
Copy Markdown
Collaborator

Description

One Line Summary

Enables the SwiftUI demo app and its extensions to build and run with Mac Catalyst.

Details

Motivation

A runnable Catalyst host is needed to validate the SDK's KMP Catalyst framework slice and platform behavior end to end.

Scope

Adds Catalyst project support, excludes unsupported Live Activity behavior, provides a Catalyst widget placeholder, and makes resilient storage tolerate a missing App Group directory.

Other

Stacked on #1715.

Local development builds may show the macOS App Group authorization prompt when their provisioning profile does not authorize the Catalyst group. Properly provisioned App Store and TestFlight builds are unaffected.

Testing

Unit testing

Added resilient-storage coverage for creating a missing container before an atomic write.

Manual testing

Built and ran the demo app on Mac Catalyst, clicked the Test Crash button, and verified the crash was logged in GCP. Also built the demo for iOS Simulator and verified Catalyst storage and Live Activities behavior.

Affected code checklist

  • Notifications
  • 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 above

Testing

  • I have included test coverage for these changes
  • Applicable automated tests pass
  • I have manually tested iOS and Catalyst builds

Final pass

  • Code is as readable as possible
  • I have reviewed this PR

Made with Cursor

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

Multimodal adversarial review (interrogate)

Verdict: Do not merge for Catalyst E2E validation until the App Group identity mismatch is fixed. The storage createDirectory change treats a misconfigured group name as a missing directory.

Intent

Enable the SwiftUI demo (and extensions) to build/run under Mac Catalyst so the SDK’s KMP Catalyst slice and platform behavior can be validated end-to-end: Catalyst project settings, Live Activities stubs/exclusions, widget placeholder, and resilient storage creating a missing container before atomic writes. Stacked on #1715.

Reviewers

  • A: claude-fable-5-thinking-xhigh — 6 findings
  • B: gpt-5.6-sol-xhigh — 2 findings
  • C: cursor-grok-4.5-high-fast — 4 findings
  • D: claude-opus-5-thinking-high — 8 findings

Act On

  1. DERIVE_MACCATALYST_PRODUCT_BUNDLE_IDENTIFIER breaks App Group naming (A/B/C/D — critical). Demo has no OneSignal_app_groups_key. SDK falls back to group.<bundleId>.onesignal. Catalyst bundle becomes maccatalyst.com.onesignal.example → computed group group.maccatalyst.com.onesignal.example.onesignal, but entitlements only grant group.com.onesignal.example.onesignal. Shared storage / NSE co-access / the PR’s own App Group prompt note all follow from this. Fix: pin OneSignal_app_groups_key on App+NSE, or disable derive so the bundle id stays com.onesignal.example.
  2. App Group prepare failure silently rehomes to Application Support (A/C/D). New do/catch falls through after a non-nil container URL. That severs the app↔NSE single-file contract and can make Catalyst “validation” look green on private storage. Keep using the group URL / fail closed once a container URL was selected.
  3. Demo Live Activities UI not actually stubbed (A/B/C/D). LiveActivitySection still mounts; start no-ops with no feedback; update/end still POST REST for activities that cannot start locally. Hide/disable the section on Catalyst (or gate all controller ops + show unavailable copy).

Consider

  • OneSignal.m Catalyst #if is largely redundant with the LiveActivities module already blanking sources; stub still logs “add the module” on Catalyst (A/D).
  • Widget placeholder vs excluding the widget target from Catalyst (A).
  • New test mostly asserts Foundation createDirectory+atomic write; misses prepare-failure / fallback behavior (A/C/D).
  • createDirectory on every fileURL() read; directory lacks NSFileProtectionNone while the file is carefully unprotected (D).
  • No CI macOS,variant=Mac Catalyst build of the demo (D).

Noted

  • Inconsistent #if around import OneSignalLiveActivities vs unguarded import in App.swift (D).
  • TEMP_* UUID churn in pbxproj from xcodegen (noise).

Dismissed

  • Dropping createDirectory entirely once group naming is fixed — still useful for a legitimately missing entitled container; keep it, but stop using it to paper over the wrong group / silent private fallback.
  • Claiming LiveActivities framework cannot link on Catalyst — module already compiles empty under targetEnvironment(macCatalyst); linking is intentional empty.

Agreement Map

All four models independently hit the derive→App Group mismatch and incomplete demo LA stubbing. Three flagged silent Application Support fallback and weak test coverage. Divergence is mostly on whether OneSignal.m guards / widget placeholder / file-protection / CI belong in Act On vs Consider — lead kept Act On to the three merge-blocking items above.

Open in Web View Automation 

Sent by Cursor Automation: Automatic PR Review

Comment thread examples/demo/project.yml
Comment thread iOS_SDK/OneSignalSDK/OneSignalOSCore/Source/OSResilientStorage.swift Outdated
Comment thread examples/demo/App/Services/LiveActivityController.swift Outdated
Comment thread iOS_SDK/OneSignalSDK/Source/OneSignal.m
Comment thread iOS_SDK/OneSignalSDK/OneSignalOSCoreTests/OSResilientStorageTests.swift Outdated
Base automatically changed from fadi/sdk-5022 to main August 18, 2026 23:53
Pin shared storage to the entitled App Group and prevent unsupported Live Activities behavior from masking Catalyst validation failures.

Co-authored-by: Cursor <cursoragent@cursor.com>
@fadi-george fadi-george changed the title feat: [SDK-5032] enable Mac Catalyst demo builds chore: [SDK-5032] enable Mac Catalyst demo builds Aug 19, 2026
Comment thread iOS_SDK/OneSignalSDK/OneSignalOSCore/Source/OSStubLiveActivities.swift Outdated
Comment thread examples/demo/App/Services/LiveActivityController.swift Outdated
Comment thread examples/demo/App/App.swift Outdated
Comment thread examples/demo/App/Info.plist
Keep Catalyst behavior explicit while avoiding unnecessary resilient-storage and Live Activities branches.

Co-authored-by: Cursor <cursoragent@cursor.com>
@fadi-george
fadi-george merged commit c85aaef into main Aug 19, 2026
2 of 3 checks passed
@fadi-george
fadi-george deleted the fadi/sdk-5032 branch August 19, 2026 17:37
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