diff --git a/GoogleUtilities/CHANGELOG.md b/GoogleUtilities/CHANGELOG.md index 48c0ab17ed7..30ce7e425c5 100644 --- a/GoogleUtilities/CHANGELOG.md +++ b/GoogleUtilities/CHANGELOG.md @@ -1,5 +1,6 @@ # 7.1.0 -- Unreleased - Added `NSURLSession` promise extension. (#6753) +- `ios_on_mac` option added to `GULAppEnvironmentUtil.applePlatform()`. (#6799) # 7.0.0 - All APIs are now public. All CocoaPods private headers are transitioned to public. Note that diff --git a/GoogleUtilities/Environment/third_party/GULAppEnvironmentUtil.m b/GoogleUtilities/Environment/third_party/GULAppEnvironmentUtil.m index b003ad5ea79..7bcf308c1c1 100644 --- a/GoogleUtilities/Environment/third_party/GULAppEnvironmentUtil.m +++ b/GoogleUtilities/Environment/third_party/GULAppEnvironmentUtil.m @@ -272,14 +272,24 @@ + (NSString *)applePlatform { #if TARGET_OS_MACCATALYST applePlatform = @"maccatalyst"; #elif TARGET_OS_IOS + +#if defined(__IPHONE_14_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 140000 + if (@available(iOS 14.0, *)) { + applePlatform = [NSProcessInfo processInfo].isiOSAppOnMac ? @"ios_on_mac" : @"ios"; + } else { + applePlatform = @"ios"; + } +#else // defined(__IPHONE_14_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 140000 applePlatform = @"ios"; +#endif // defined(__IPHONE_14_0) && __IPHONE_OS_VERSION_MAX_ALLOWED >= 140000 + #elif TARGET_OS_TV applePlatform = @"tvos"; #elif TARGET_OS_OSX applePlatform = @"macos"; #elif TARGET_OS_WATCH applePlatform = @"watchos"; -#endif +#endif // TARGET_OS_MACCATALYST return applePlatform; }