Skip to content

Commit 760d449

Browse files
authored
[visionOS] Fix FirebaseDatabase build on Xcode 15.1 beta 1 (#11937)
1 parent 9425f60 commit 760d449

File tree

4 files changed

+16
-8
lines changed

4 files changed

+16
-8
lines changed

FirebaseDatabase/Sources/Core/FPersistentConnection.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1256,7 +1256,8 @@ - (void)sendStats:(NSDictionary *)stats {
12561256
- (void)sendConnectStats {
12571257
NSMutableDictionary *stats = [NSMutableDictionary dictionary];
12581258

1259-
#if TARGET_OS_IOS || TARGET_OS_TV
1259+
#if TARGET_OS_IOS || TARGET_OS_TV || \
1260+
(defined(TARGET_OS_VISION) && TARGET_OS_VISION)
12601261
if (self.config.persistenceEnabled) {
12611262
stats[@"persistence.ios.enabled"] = @1;
12621263
}

FirebaseDatabase/Sources/Core/FRepo.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@
5252
#import "FirebaseDatabase/Sources/Utilities/Tuples/FTupleTransaction.h"
5353
#import <dlfcn.h>
5454

55-
#if TARGET_OS_IOS || TARGET_OS_TV
55+
#if TARGET_OS_IOS || TARGET_OS_TV || \
56+
(defined(TARGET_OS_VISION) && TARGET_OS_VISION)
5657
#import <UIKit/UIKit.h>
5758
#endif
5859

@@ -815,7 +816,8 @@ - (void)didEnterBackground {
815816

816817
// Targetted compilation is ONLY for testing. UIKit is weak-linked in actual
817818
// release build.
818-
#if TARGET_OS_IOS || TARGET_OS_TV
819+
#if TARGET_OS_IOS || TARGET_OS_TV || \
820+
(defined(TARGET_OS_VISION) && TARGET_OS_VISION)
819821
// The idea is to wait until any outstanding sets get written to disk. Since
820822
// the sets might still be in our dispatch queue, we wait for the dispatch
821823
// queue to catch up and for persistence to catch up. This may be

FirebaseDatabase/Sources/Persistence/FLevelDBStorageEngine.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,8 @@ - (void)close {
275275
}
276276

277277
+ (NSString *)firebaseDir {
278-
#if TARGET_OS_IOS || TARGET_OS_WATCH
278+
#if TARGET_OS_IOS || TARGET_OS_WATCH || \
279+
(defined(TARGET_OS_VISION) && TARGET_OS_VISION)
279280
NSArray *dirPaths = NSSearchPathForDirectoriesInDomains(
280281
NSDocumentDirectory, NSUserDomainMask, YES);
281282
NSString *documentsDir = [dirPaths objectAtIndex:0];

FirebaseDatabase/Sources/Realtime/FWebSocketConnection.m

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,11 @@
2626
#import "FirebaseDatabase/Sources/Realtime/FWebSocketConnection.h"
2727
#import "FirebaseDatabase/Sources/Utilities/FStringUtilities.h"
2828

29-
#if TARGET_OS_IOS || TARGET_OS_TV
29+
#if TARGET_OS_IOS || TARGET_OS_TV || \
30+
(defined(TARGET_OS_VISION) && TARGET_OS_VISION)
3031
#import <UIKit/UIKit.h>
31-
#endif // TARGET_OS_IOS || TARGET_OS_TV
32+
#endif // TARGET_OS_IOS || TARGET_OS_TV || (defined(TARGET_OS_VISION) &&
33+
// TARGET_OS_VISION)
3234

3335
#if TARGET_OS_WATCH
3436
#import <Network/Network.h>
@@ -144,14 +146,16 @@ - (NSString *)userAgent {
144146

145147
// Targetted compilation is ONLY for testing. UIKit is weak-linked in actual
146148
// release build.
147-
#if TARGET_OS_IOS || TARGET_OS_TV
149+
#if TARGET_OS_IOS || TARGET_OS_TV || \
150+
(defined(TARGET_OS_VISION) && TARGET_OS_VISION)
148151
Class uiDeviceClass = NSClassFromString(@"UIDevice");
149152
if (uiDeviceClass) {
150153
systemVersion = [uiDeviceClass currentDevice].systemVersion;
151154
deviceName = [uiDeviceClass currentDevice].model;
152155
hasUiDeviceClass = YES;
153156
}
154-
#endif // TARGET_OS_IOS || TARGET_OS_TV
157+
#endif // TARGET_OS_IOS || TARGET_OS_TV || (defined(TARGET_OS_VISION) &&
158+
// TARGET_OS_VISION)
155159

156160
if (!hasUiDeviceClass) {
157161
NSDictionary *systemVersionDictionary = [NSDictionary

0 commit comments

Comments
 (0)