Skip to content

Commit

Permalink
fix: gh-action failing to find isiOSAppOnMac on processInfo
Browse files Browse the repository at this point in the history
  • Loading branch information
erisu committed Apr 6, 2022
1 parent 396e8c7 commit 8938cf7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
11 changes: 7 additions & 4 deletions src/ios/CDVDevice.m
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ Licensed to the Apache Software Foundation (ASF) under one
#include <sys/sysctl.h>
#include "TargetConditionals.h"

#import <Availability.h>

#import <Cordova/CDV.h>
#import "CDVDevice.h"

Expand Down Expand Up @@ -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
14 changes: 9 additions & 5 deletions src/osx/CDVDevice.m
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ Licensed to the Apache Software Foundation (ASF) under one

#include <sys/sysctl.h>

#import <Availability.h>

#import "CDVDevice.h"

#define SYSTEM_VERSION_PLIST @"/System/Library/CoreServices/SystemVersion.plist"
Expand Down Expand Up @@ -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

0 comments on commit 8938cf7

Please sign in to comment.