ReviewOS

craft-native/craft

fix(ios): add required WCSessionDelegate methods to generated Watch app

#193
Closed glennmichael123 opened this 10 days ago ·
10 days ago

Reproduction

With Craft revision 26d927f7f927e4db2c85c3df89368d3f3b745dba and a project using watchApp: true, generate the iOS project and compile it with current Xcode:

xcodebuild -project WildLoop.xcodeproj -target WildLoop -sdk iphonesimulator -configuration Debug CODE_SIGNING_ALLOWED=NO build

Actual

The generated WatchApp/WildLoopWatchApp.swift fails to compile because CraftWatchSession declares WCSessionDelegate but omits the required methods:

type CraftWatchSession does not conform to protocol WCSessionDelegate
protocol requires sessionDidBecomeInactive(_:)
protocol requires sessionDidDeactivate(_:)

The generated full scheme also cannot run when the matching watchOS simulator runtime is absent, but compiling the phone target directly reaches the Swift conformance failure above.

Expected

A generated app with watchApp: true should compile on current Xcode. The generated delegate should provide the required iOS callbacks, with deactivation reactivating the session as appropriate.

Notes

This blocks native simulator validation for a Stacks mobile app that uses Craft watch connectivity.

Sign in to comment on this issue.