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

Add support for checking if the iOS app is running on macOS #10

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Robert27
Copy link
Contributor

@Robert27 Robert27 commented Aug 14, 2024

MacOS makes it possible to run iPad apps on Mac with M chip. This means that React Native still returns Platform iOS and isPad true. For analytics, however, it would be helpful to know the number of MacOS users.
To cover this scenario, I have added the isiOSAppOnMac check to the Swift module so that the right operating system is logged.

Regarding the OS version, there are two options:

  • ProcessInfo.processInfo.operatingSystemVersion: 17.6.0 --> Version of the emulated iPad
  • ProcessInfo.processInfo.operatingSystemVersionString: Version 14.6 (Build 23G80) --> Should be same, but apparently it's the MacOS Version with extra formatting

Option 1 could lead to confusion, as MacOS is specified as the operating system.
Option 2 cannot be confirmed in the Apple documentation and might be a bug. Also Apple does not recommend to continue parse this value.

It would probably be the best to rename the operating system value to "MacOS (designed for iPad)", but the dashboard does currently not show the proper icon. The other option would be to add a note before the version, such as "iPadOS 14.6.0".

I would appreciate feedback and further opinions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant