18
18
19
19
#if defined(__APPLE__)
20
20
21
- #if TARGET_OS_IOS || TARGET_OS_TV
21
+ #if TARGET_OS_IOS || TARGET_OS_TV || \
22
+ (defined(TARGET_OS_VISION) && TARGET_OS_VISION)
22
23
#import < UIKit/UIKit.h>
23
24
#endif
24
25
@@ -49,7 +50,7 @@ NetworkStatus ToNetworkStatus(SCNetworkReachabilityFlags flags) {
49
50
return NetworkStatus::Unavailable;
50
51
}
51
52
52
- #if TARGET_OS_IPHONE
53
+ #if TARGET_OS_IPHONE || (defined(TARGET_OS_VISION) && TARGET_OS_VISION)
53
54
if (flags & kSCNetworkReachabilityFlagsIsWWAN ) {
54
55
return NetworkStatus::AvailableViaCellular;
55
56
}
@@ -112,7 +113,8 @@ explicit ConnectivityMonitorApple(
112
113
return ;
113
114
}
114
115
115
- #if TARGET_OS_IOS || TARGET_OS_TV
116
+ #if TARGET_OS_IOS || TARGET_OS_TV || \
117
+ (defined (TARGET_OS_VISION) && TARGET_OS_VISION)
116
118
this ->observer_ = [[NSNotificationCenter defaultCenter ]
117
119
addObserverForName: UIApplicationWillEnterForegroundNotification
118
120
object: nil
@@ -124,7 +126,8 @@ explicit ConnectivityMonitorApple(
124
126
}
125
127
126
128
~ConnectivityMonitorApple () {
127
- #if TARGET_OS_IOS || TARGET_OS_TV
129
+ #if TARGET_OS_IOS || TARGET_OS_TV || \
130
+ (defined (TARGET_OS_VISION) && TARGET_OS_VISION)
128
131
[[NSNotificationCenter defaultCenter ] removeObserver: this ->observer_];
129
132
#endif
130
133
@@ -139,7 +142,8 @@ explicit ConnectivityMonitorApple(
139
142
}
140
143
}
141
144
142
- #if TARGET_OS_IOS || TARGET_OS_TV
145
+ #if TARGET_OS_IOS || TARGET_OS_TV || \
146
+ (defined(TARGET_OS_VISION) && TARGET_OS_VISION)
143
147
void OnEnteredForeground () {
144
148
SCNetworkReachabilityFlags flags{};
145
149
if (!SCNetworkReachabilityGetFlags (reachability_, &flags)) return ;
@@ -167,7 +171,8 @@ void OnReachabilityChanged(SCNetworkReachabilityFlags flags) {
167
171
168
172
private:
169
173
SCNetworkReachabilityRef reachability_ = nil ;
170
- #if TARGET_OS_IOS || TARGET_OS_TV
174
+ #if TARGET_OS_IOS || TARGET_OS_TV || \
175
+ (defined(TARGET_OS_VISION) && TARGET_OS_VISION)
171
176
id <NSObject > observer_ = nil ;
172
177
#endif
173
178
};
0 commit comments