@@ -204,7 +204,7 @@ - (void)dealloc {
204204#endif
205205}
206206
207- #if TARGET_OS_IPHONE && !defined TARGET_OS_IPHONE_EXTENSION
207+ #if TARGET_OS_IPHONE
208208
209209// Always called on main thread
210210- (void )_startBackgroundTask {
@@ -229,7 +229,7 @@ - (void)_didConnect {
229229 _connected = YES ;
230230 GWS_LOG_DEBUG (@" Did connect" );
231231
232- #if TARGET_OS_IPHONE && !defined TARGET_OS_IPHONE_EXTENSION
232+ #if TARGET_OS_IPHONE
233233 if ([[UIApplication sharedApplication ] applicationState ] != UIApplicationStateBackground) {
234234 [self _startBackgroundTask ];
235235 }
@@ -259,7 +259,7 @@ - (void)willStartConnection:(GCDWebServerConnection*)connection {
259259 });
260260}
261261
262- #if TARGET_OS_IPHONE && !defined TARGET_OS_IPHONE_EXTENSION
262+ #if TARGET_OS_IPHONE
263263
264264// Always called on main thread
265265- (void )_endBackgroundTask {
@@ -283,7 +283,7 @@ - (void)_didDisconnect {
283283 _connected = NO ;
284284 GWS_LOG_DEBUG (@" Did disconnect" );
285285
286- #if TARGET_OS_IPHONE && !defined TARGET_OS_IPHONE_EXTENSION
286+ #if TARGET_OS_IPHONE
287287 [self _endBackgroundTask ];
288288#endif
289289
@@ -732,7 +732,7 @@ - (void)_willEnterForeground:(NSNotification*)notification {
732732- (BOOL )startWithOptions : (NSDictionary <NSString*, id>*)options error : (NSError **)error {
733733 if (_options == nil ) {
734734 _options = options ? [options copy ] : @{};
735- #if TARGET_OS_IPHONE && !defined TARGET_OS_IPHONE_EXTENSION
735+ #if TARGET_OS_IPHONE
736736 _suspendInBackground = [(NSNumber *)_GetOption (_options, GCDWebServerOption_AutomaticallySuspendInBackground, @YES ) boolValue ];
737737 if (((_suspendInBackground == NO ) || ([[UIApplication sharedApplication ] applicationState ] != UIApplicationStateBackground)) && ![self _start: error])
738738#else
0 commit comments