-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1918 from jfiser-paylocity/develop
[Issue #125] Enable DatadogCore and DatadogLogs to compile on watchOS platform
- Loading branch information
Showing
21 changed files
with
212 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
DatadogInternal/Sources/Context/ApplicationNotifications.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/* | ||
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0. | ||
* This product includes software developed at Datadog (https://www.datadoghq.com/). | ||
* Copyright 2019-Present Datadog, Inc. | ||
*/ | ||
|
||
import Foundation | ||
|
||
#if canImport(UIKit) | ||
import UIKit | ||
#if canImport(WatchKit) | ||
import WatchKit | ||
#endif | ||
|
||
/// Convenient wrapper to get system notifications independent from platform | ||
public enum ApplicationNotifications { | ||
public static var didBecomeActive: Notification.Name { | ||
#if canImport(WatchKit) | ||
WKExtension.applicationDidBecomeActiveNotification | ||
#else | ||
UIApplication.didBecomeActiveNotification | ||
#endif | ||
} | ||
|
||
public static var willResignActive: Notification.Name { | ||
#if canImport(WatchKit) | ||
WKExtension.applicationWillResignActiveNotification | ||
#else | ||
UIApplication.willResignActiveNotification | ||
#endif | ||
} | ||
|
||
public static var didEnterBackground: Notification.Name { | ||
#if canImport(WatchKit) | ||
WKExtension.applicationDidEnterBackgroundNotification | ||
#else | ||
UIApplication.didEnterBackgroundNotification | ||
#endif | ||
} | ||
|
||
public static var willEnterForeground: Notification.Name { | ||
#if canImport(WatchKit) | ||
WKExtension.applicationWillEnterForegroundNotification | ||
#else | ||
UIApplication.willEnterForegroundNotification | ||
#endif | ||
} | ||
} | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.