From 8938cf78de78178dd657273596ae48054ed51b6f Mon Sep 17 00:00:00 2001 From: Erisu Date: Wed, 6 Apr 2022 13:33:21 +0900 Subject: [PATCH] fix: gh-action failing to find isiOSAppOnMac on processInfo --- src/ios/CDVDevice.m | 11 +++++++---- src/osx/CDVDevice.m | 14 +++++++++----- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/ios/CDVDevice.m b/src/ios/CDVDevice.m index 675693a..7315489 100644 --- a/src/ios/CDVDevice.m +++ b/src/ios/CDVDevice.m @@ -21,6 +21,8 @@ Licensed to the Apache Software Foundation (ASF) under one #include #include "TargetConditionals.h" +#import + #import #import "CDVDevice.h" @@ -116,12 +118,13 @@ - (BOOL)isVirtual - (BOOL) isiOSAppOnMac { + #if __IPHONE_14_0 if (@available(iOS 14.0, *)) { - return [NSProcessInfo processInfo].isiOSAppOnMac; - } else { - // Fallback on earlier versions, and platforms - return false; + return [[NSProcessInfo processInfo] isiOSAppOnMac]; } + #endif + + return false; } @end diff --git a/src/osx/CDVDevice.m b/src/osx/CDVDevice.m index 0cef13a..dd6f811 100644 --- a/src/osx/CDVDevice.m +++ b/src/osx/CDVDevice.m @@ -19,6 +19,8 @@ Licensed to the Apache Software Foundation (ASF) under one #include +#import + #import "CDVDevice.h" #define SYSTEM_VERSION_PLIST @"/System/Library/CoreServices/SystemVersion.plist" @@ -110,13 +112,15 @@ + (NSString*) cordovaVersion { return CDV_VERSION; } -+ (BOOL) isiOSAppOnMac { +- (BOOL) isiOSAppOnMac +{ + #if __IPHONE_14_0 if (@available(iOS 14.0, *)) { - return [NSProcessInfo processInfo].isiOSAppOnMac; - } else { - // Fallback on earlier versions and platforms - return false; + return [[NSProcessInfo processInfo] isiOSAppOnMac]; } + #endif + + return false; } @end