|
34 | 34 | #import "FirebaseDatabase/Sources/Utilities/FUtilities.h" |
35 | 35 | #import "FirebaseDatabase/Sources/Utilities/Tuples/FTupleCallbackStatus.h" |
36 | 36 | #import "FirebaseDatabase/Sources/Utilities/Tuples/FTupleOnDisconnect.h" |
37 | | -#if TARGET_OS_WATCH |
38 | | -#import <WatchKit/WatchKit.h> |
39 | | -#else |
| 37 | +#if !TARGET_OS_WATCH |
40 | 38 | #import <SystemConfiguration/SystemConfiguration.h> |
41 | | -#endif // TARGET_OS_WATCH |
| 39 | +#endif // !TARGET_OS_WATCH |
42 | 40 | #import <dlfcn.h> |
43 | 41 | #import <netinet/in.h> |
44 | 42 |
|
@@ -168,7 +166,6 @@ - (id)initWithRepoInfo:(FRepoInfo *)repoInfo |
168 | 166 | retryExponent:kPersistentConnReconnectMultiplier |
169 | 167 | jitterFactor:0.7]; |
170 | 168 |
|
171 | | - [self setupNotifications]; |
172 | 169 | // Make sure we don't actually connect until open is called |
173 | 170 | [self interruptForReason:kFInterruptReasonWaitingForOpen]; |
174 | 171 | } |
@@ -553,29 +550,6 @@ - (void)openNetworkConnectionWithContext: |
553 | 550 | [self.realtime open]; |
554 | 551 | } |
555 | 552 |
|
556 | | -- (void)enteringForeground { |
557 | | - dispatch_async(self.dispatchQueue, ^{ |
558 | | - // Reset reconnect delay |
559 | | - [self.retryHelper signalSuccess]; |
560 | | - if (self->connectionState == ConnectionStateDisconnected) { |
561 | | - [self tryScheduleReconnect]; |
562 | | - } |
563 | | - }); |
564 | | -} |
565 | | - |
566 | | -- (void)setupNotifications { |
567 | | -#if TARGET_OS_WATCH |
568 | | - __weak FPersistentConnection *weakSelf = self; |
569 | | - NSNotificationCenter *center = [NSNotificationCenter defaultCenter]; |
570 | | - [center addObserverForName:WKApplicationWillEnterForegroundNotification |
571 | | - object:nil |
572 | | - queue:nil |
573 | | - usingBlock:^(NSNotification *_Nonnull note) { |
574 | | - [weakSelf enteringForeground]; |
575 | | - }]; |
576 | | -#endif // TARGET_OS_WATCH |
577 | | -} |
578 | | - |
579 | 553 | - (void)sendAuthAndRestoreStateAfterComplete:(BOOL)restoreStateAfterComplete { |
580 | 554 | NSAssert([self connected], @"Must be connected to send auth"); |
581 | 555 | NSAssert(self.authToken != nil, |
|
0 commit comments