Skip to content

Commit 95cf485

Browse files
authored
Fix VisionOS and WatchOS CI (#12966)
1 parent 5a1763b commit 95cf485

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

.github/workflows/spm.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,16 +88,15 @@ jobs:
8888
strategy:
8989
matrix:
9090
# Full set of Firebase-Package tests only run on iOS. Run subset on other platforms.
91+
# visionOS isn't buildable from here (even with Firestore source) because the test
92+
# targets need Analytics.
9193
target: [tvOS, macOS, catalyst]
9294
os: [macos-13, macos-14]
9395
include:
9496
- os: macos-13
9597
xcode: Xcode_15.2
9698
- os: macos-14
9799
xcode: Xcode_15.3
98-
- os: macos-14
99-
target: visionOS
100-
xcode: Xcode_15.3
101100
runs-on: ${{ matrix.os }}
102101
steps:
103102
- uses: actions/checkout@v4

FirebaseInAppMessaging/Sources/Flows/FIRIAMDisplayExecutor.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,8 +363,10 @@ - (void)displayMessageLoadError:(NSError *)error {
363363
return;
364364
}
365365
self.alertWindow = [[UIWindow alloc] initWithWindowScene:foregroundedScene];
366+
#if TARGET_OS_IOS || TARGET_OS_TV
366367
} else {
367368
self.alertWindow = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
369+
#endif
368370
}
369371
UIViewController *alertViewController = [[UIViewController alloc] init];
370372
self.alertWindow.rootViewController = alertViewController;

scripts/build.sh

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,12 @@ tvos_flags=(
169169
-destination 'platform=tvOS Simulator,name=Apple TV'
170170
)
171171
watchos_flags=(
172+
-sdk 'watchsimulator'
172173
-destination 'platform=watchOS Simulator,name=Apple Watch Series 7 (45mm)'
173174
)
174175
visionos_flags=(
175-
-destination 'platform=visionOS Simulator'
176+
-sdk 'xrsimulator'
177+
-destination 'platform=visionOS Simulator,name=Apple Vision Pro'
176178
)
177179
catalyst_flags=(
178180
ARCHS=x86_64 VALID_ARCHS=x86_64 SUPPORTS_MACCATALYST=YES -sdk macosx
@@ -409,12 +411,16 @@ case "$product-$platform-$method" in
409411
fi
410412
;;
411413

414+
# TODO: This is actually building for iOS instead of watchOS. Update to use
415+
# watchOS xcb_flags along with the watchOS sdk option. Also nanopb and promises
416+
# podspecs need minimum version updates.
417+
412418
MessagingSampleStandaloneWatchApp-*-*)
413419
if check_secrets; then
414420
RunXcodebuild \
415421
-workspace 'FirebaseMessaging/Apps/SampleStandaloneWatchApp/SampleStandaloneWatchApp.xcworkspace' \
416422
-scheme "SampleStandaloneWatchApp Watch App" \
417-
"${xcb_flags[@]}" \
423+
-destination 'platform=watchOS Simulator,name=Apple Watch Series 7 (45mm)' \
418424
build
419425
fi
420426
;;

0 commit comments

Comments
 (0)