12
12
// See the License for the specific language governing permissions and
13
13
// limitations under the License.
14
14
15
+ #if __has_include(<UIKit/UIKit.h>)
16
+ #import < UIKit/UIKit.h>
17
+ #endif
18
+
19
+ #if __has_include(<AppKit/AppKit.h>)
20
+ #import < AppKit/AppKit.h>
21
+ #endif
22
+
23
+ #if __has_include(<WatchKit/WatchKit.h>)
24
+ #import < WatchKit/WatchKit.h>
25
+ #endif
26
+
15
27
#import " FirebaseCore/Tests/Unit/FIRTestCase.h"
16
28
#import " FirebaseCore/Tests/Unit/FIRTestComponents.h"
17
29
@@ -827,7 +839,6 @@ - (void)testIsDefaultAppConfigured {
827
839
828
840
#pragma mark - Core Telemetry
829
841
830
- #if !TARGET_OS_WATCH
831
842
- (void )testCoreDiagnosticsLoggedWhenAppDidBecomeActive {
832
843
FIRApp *app = [self createConfiguredAppWithName: NSStringFromSelector (_cmd )];
833
844
[self expectCoreDiagnosticsDataLogWithOptions: app.options];
@@ -845,7 +856,6 @@ - (void)testHeartbeatLogIsAttemptedWhenAppDidBecomeActive {
845
856
object: nil ];
846
857
OCMVerifyAll (self.mockHeartbeatLogger );
847
858
}
848
- #endif // TARGET_OS_WATCH
849
859
850
860
#pragma mark - private
851
861
@@ -890,10 +900,15 @@ - (void)expectCoreDiagnosticsDataLogWithOptions:(nullable FIROptions *)expectedO
890
900
- (NSNotificationName )appDidBecomeActiveNotificationName {
891
901
#if TARGET_OS_IOS || TARGET_OS_TV
892
902
return UIApplicationDidBecomeActiveNotification;
893
- #endif
894
-
895
- #if TARGET_OS_OSX
903
+ #elif TARGET_OS_OSX
896
904
return NSApplicationDidBecomeActiveNotification ;
905
+ #elif TARGET_OS_WATCH
906
+ // See comment in `- [FIRApp subscribeForAppDidBecomeActiveNotifications]`.
907
+ if (@available (watchOS 7.0 , *)) {
908
+ return WKApplicationDidBecomeActiveNotification;
909
+ } else {
910
+ return kFIRAppReadyToConfigureSDKNotification ;
911
+ }
897
912
#endif
898
913
}
899
914
0 commit comments