Skip to content
This repository has been archived by the owner on May 15, 2024. It is now read-only.

[Enhancement] Add isiOSAppOnMac property #1700

Open
VasenevEA opened this issue Feb 23, 2021 · 4 comments
Open

[Enhancement] Add isiOSAppOnMac property #1700

VasenevEA opened this issue Feb 23, 2021 · 4 comments
Labels
feature-request A request for a new feature.

Comments

@VasenevEA
Copy link

Summary

With the release of computers on Apple Silicone, we got another platform on which the Xamarin application can run.
We need a simple way to find out which device we are running on:
iOS device or iOS on Mac

API Changes

add to DevicePlatform:

public static DevicePlatform iOSOnMac { get; } = new DevicePlatform(nameof(iOSOnMac));

Intended Use Case


if (DeviceInfo.Platform == DevicePlatform.iOSOnMac)
{
  //specific code
}
@VasenevEA VasenevEA added the feature-request A request for a new feature. label Feb 23, 2021
@jamesmontemagno
Copy link
Collaborator

Is available => https://stackoverflow.com/questions/65042788/how-to-detect-if-an-ios-app-is-running-on-an-m1-mac

I don't think it should be the device platform though to be honest with you as it would break a bunch of logic trees.

@jamesmontemagno
Copy link
Collaborator

I think we want to return "Desktop" for DeviceType in this case.

So you could do:

If(DeviceInfo.Platform == DevicePlatform.iOS && DeviceInfo.DeviceType == DeviceType.Desktop) { }

@jamesmontemagno
Copy link
Collaborator

Also need to coordinate with XF team

@VasenevEA
Copy link
Author

I think we want to return "Desktop" for DeviceType in this case.

So you could do:

If(DeviceInfo.Platform == DevicePlatform.iOS && DeviceInfo.DeviceType == DeviceType.Desktop) { }

It will be great!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request A request for a new feature.
Projects
None yet
Development

No branches or pull requests

2 participants