diff options
author | Ryan Wilson <wilsonryan@google.com> | 2018-01-02 18:43:04 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-01-02 18:43:04 -0500 |
commit | 7ab9c3c498a3cadb7a1d1a706642e10d228d4690 (patch) | |
tree | 89e2258be469a5dd12e24a62ccda2f348db1ff5a /Firebase/Core | |
parent | c4dcfaa49eca773a0ccc2ffa5514fb8ef8eaa4fb (diff) |
Remove FIRAppEnvironmentUtil's sharedApplication (#603)
* Deprecate FIRAppEnvironmentUtil sharedApplication
* Remove sharedApplication private API.
This also allows us to remove an AppKit dependency.
* Disable autolink when building FirebaseCore (#606)
This prevents the dependencies of FirebaseCore's dependencies from
bleeding into its interface.
The proximate benefit of avoiding this is that FirebaseCore no longer
ends up depending on ColorSync.framework which became a top-level system
framework in 10.13. This makes it possible to build against the
resulting FirebaseCore.framework on macOS 10.12 using Xcode 9 (with the
macOS 10.13 SDK).
Diffstat (limited to 'Firebase/Core')
-rw-r--r-- | Firebase/Core/third_party/FIRAppEnvironmentUtil.h | 14 | ||||
-rw-r--r-- | Firebase/Core/third_party/FIRAppEnvironmentUtil.m | 22 |
2 files changed, 3 insertions, 33 deletions
diff --git a/Firebase/Core/third_party/FIRAppEnvironmentUtil.h b/Firebase/Core/third_party/FIRAppEnvironmentUtil.h index 7ae9827..09ee504 100644 --- a/Firebase/Core/third_party/FIRAppEnvironmentUtil.h +++ b/Firebase/Core/third_party/FIRAppEnvironmentUtil.h @@ -16,12 +16,6 @@ #import <Foundation/Foundation.h> -#if TARGET_OS_IOS -#import <UIKit/UIKit.h> -#elif TARGET_OS_OSX -#import <AppKit/AppKit.h> -#endif - @interface FIRAppEnvironmentUtil : NSObject /// Indicates whether the app is from Apple Store or not. Returns NO if the app is on simulator, @@ -46,12 +40,4 @@ /// Indicates whether it is running inside an extension or an app. + (BOOL)isAppExtension; -#if TARGET_OS_IOS -/// Returns the [UIApplication sharedApplication] if it is running on an app, not an extension. -+ (UIApplication *)sharedApplication; -#elif TARGET_OS_OSX -/// Returns the [NSApplication sharedApplication]. -+ (NSApplication *)sharedApplication; -#endif - @end diff --git a/Firebase/Core/third_party/FIRAppEnvironmentUtil.m b/Firebase/Core/third_party/FIRAppEnvironmentUtil.m index fe4e23d..859c04e 100644 --- a/Firebase/Core/third_party/FIRAppEnvironmentUtil.m +++ b/Firebase/Core/third_party/FIRAppEnvironmentUtil.m @@ -13,6 +13,9 @@ // limitations under the License. #import <Foundation/Foundation.h> +#if TARGET_OS_IOS || TARGET_OS_TV +#import <UIKit/UIKit.h> +#endif #import "FIRAppEnvironmentUtil.h" @@ -221,25 +224,6 @@ static BOOL isAppEncrypted() { #endif } -#if TARGET_OS_IOS -+ (UIApplication *)sharedApplication { - if ([FIRAppEnvironmentUtil isAppExtension]) { - return nil; - } - id sharedApplication = nil; - Class uiApplicationClass = NSClassFromString(@"UIApplication"); - if (uiApplicationClass && - [uiApplicationClass respondsToSelector:(NSSelectorFromString(@"sharedApplication"))]) { - sharedApplication = [uiApplicationClass sharedApplication]; - } - return sharedApplication; -} -#elif TARGET_OS_OSX -+ (NSApplication *)sharedApplication { - return [NSApplication sharedApplication]; -} -#endif - #pragma mark - Helper methods + (BOOL)hasSCInfoFolder { |