chore: [SDK-5032] enable Mac Catalyst demo builds - #1716
Conversation
There was a problem hiding this comment.
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
DERIVE_MACCATALYST_PRODUCT_BUNDLE_IDENTIFIERbreaks App Group naming (A/B/C/D — critical). Demo has noOneSignal_app_groups_key. SDK falls back togroup.<bundleId>.onesignal. Catalyst bundle becomesmaccatalyst.com.onesignal.example→ computed groupgroup.maccatalyst.com.onesignal.example.onesignal, but entitlements only grantgroup.com.onesignal.example.onesignal. Shared storage / NSE co-access / the PR’s own App Group prompt note all follow from this. Fix: pinOneSignal_app_groups_keyon App+NSE, or disable derive so the bundle id stayscom.onesignal.example.- App Group prepare failure silently rehomes to Application Support (A/C/D). New
do/catchfalls 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. - Demo Live Activities UI not actually stubbed (A/B/C/D).
LiveActivitySectionstill mounts;startno-ops with no feedback;update/endstill POST REST for activities that cannot start locally. Hide/disable the section on Catalyst (or gate all controller ops + show unavailable copy).
Consider
OneSignal.mCatalyst#ifis 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). createDirectoryon everyfileURL()read; directory lacksNSFileProtectionNonewhile the file is carefully unprotected (D).- No CI
macOS,variant=Mac Catalystbuild of the demo (D).
Noted
- Inconsistent
#ifaroundimport OneSignalLiveActivitiesvs unguarded import inApp.swift(D). - TEMP_* UUID churn in pbxproj from xcodegen (noise).
Dismissed
- Dropping
createDirectoryentirely 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.
Sent by Cursor Automation: Automatic PR Review
a0f0e53 to
c45ec8e
Compare
864c6aa to
1e4e6a5
Compare
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>
Keep Catalyst behavior explicit while avoiding unnecessary resilient-storage and Live Activities branches. Co-authored-by: Cursor <cursoragent@cursor.com>
45f2281 to
2eb5bf0
Compare


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
Checklist
Overview
Testing
Final pass
Made with Cursor