8000 Add visionOS support (#433) (#443) by oberbeck · Pull Request #465 · matomo-org/matomo-sdk-ios · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Add visionOS support (#433) (#443) #465

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions MatomoTracker.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@
MACOSX_DEPLOYMENT_TARGET = 10.12;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SUPPORTED_PLATFORMS = "macosx appletvos appletvsimulator iphoneos iphonesimulator";
SUPPORTED_PLATFORMS = "macosx appletvos appletvsimulator iphoneos iphonesimulator xrsimulator xros";
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
Expand Down Expand Up @@ -569,7 +569,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 10.0;
MACOSX_DEPLOYMENT_TARGET = 10.12;
MTL_ENABLE_DEBUG_INFO = NO;
SUPPORTED_PLATFORMS = "macosx appletvos appletvsimulator iphoneos iphonesimulator";
SUPPORTED_PLATFORMS = "macosx appletvos appletvsimulator iphoneos iphonesimulator xrsimulator xros";
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2";
Expand Down Expand Up @@ -599,7 +599,7 @@
PRODUCT_BUNDLE_IDENTIFIER = org.matomo.MatomoTracker;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos appletvsimulator appletvos macosx";
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos appletvsimulator appletvos macosx xrsimulator xros";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2,3,4";
Expand All @@ -625,7 +625,7 @@
PRODUCT_BUNDLE_IDENTIFIER = org.matomo.MatomoTracker;
PRODUCT_NAME = "$(TARGET_NAME)";
SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos appletvsimulator appletvos macosx";
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos appletvsimulator appletvos macosx xrsimulator xros";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2,3,4";
VALID_ARCHS = "i386 x86_64 arm64 armv7 armv7s";
Expand Down
12 changes: 11 additions & 1 deletion MatomoTracker/Device.swift
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ extension Device {
return nil
}
}
#elseif os(iOS) || os(tvOS)
#elseif os(iOS) || os(tvOS) || os(visionOS)
import UIKit
extension Device {
internal static func operatingSystemForCurrentDevice() -> String {
Expand All @@ -105,6 +105,8 @@ extension Device {
return "tvOS"
#elseif os(watchOS)
return "watchOS"
#elseif os(visionOS)
return "visionOS"
#endif
}

Expand All @@ -115,14 +117,22 @@ extension Device {

// Returns the screen size in points
internal static func screenSizeForCurrentDevice() -> CGSize {
#if os(visionOS)
return CGSize.zero
#else
let bounds = UIScreen.main.bounds
return bounds.size
#endif
}

// Returns the screen size in pixels
internal static func nativeScreenSizeForCurrentDevice() -> CGSize {
#if os(visionOS)
return CGSize.zero
#else
let bounds = UIScreen.main.nativeBounds
return bounds.size
#endif
}
}
#elseif os(watchOS)
Expand Down
Loading
0