Skip to content
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

Unable to detect Apps on M1 and M2 Macs #2089

Open
logikonline opened this issue Jun 1, 2023 · 3 comments
Open

Unable to detect Apps on M1 and M2 Macs #2089

logikonline opened this issue Jun 1, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@logikonline
Copy link

Description

Essentials doesn't properly detect apps on the MacOS, mistaking them for Tablets

Steps to Reproduce

  1. Install on M1 or M2
  2. Read device Idiom

Expected Behavior

Should report Desktop

Actual Behavior

Reports Tablet

@logikonline logikonline added the bug Something isn't working label Jun 1, 2023
@logikonline
Copy link
Author

        switch (UIDevice.CurrentDevice.UserInterfaceIdiom)
        {
            case UIUserInterfaceIdiom.Pad:
                return DeviceIdiom.Tablet;
            case UIUserInterfaceIdiom.Phone:
                return DeviceIdiom.Phone;
            case UIUserInterfaceIdiom.TV:
                return DeviceIdiom.TV;
            case UIUserInterfaceIdiom.CarPlay:
            case UIUserInterfaceIdiom.Unspecified:
            default:
                return DeviceIdiom.Unknown;
        }

Add
case UIUserInterfaceIdiom.Mac:
return DeviceIdiom.Desktop;

To this code section

@logikonline
Copy link
Author

Please fix this in Maui too

@logikonline
Copy link
Author

If additional helper routines are needed, these should assist the dev.

`//A Boolean value that indicates whether the process is an iPhone or iPad app running on a Mac.

  • (BOOL) isIosAppOnMac {
    if (@available(iOS 14.0, *)) {
    NSProcessInfo *const processInfo = [[NSProcessInfo alloc] init];
    return processInfo.iOSAppOnMac;
    } else {
    return false;
    }
    }
    //A Boolean value that indicates whether the process originated as an iOS app and runs on macOS.
    //This is for if specifically making the app use AppKit APIs
    //https://developer.apple.com/documentation/uikit/mac_catalyst
  • (BOOL) isCatalystApp {
    if (@available(iOS 14.0, *)) {
    NSProcessInfo *const processInfo = [[NSProcessInfo alloc] init];
    return processInfo.macCatalystApp;
    } else {
    return false;
    }
    }`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant