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

feat(ios): detect if app is running on a macOS desktop with Apple Silicon #167

Merged
merged 5 commits into from
Apr 7, 2022

Conversation

erisu
Copy link
Member

@erisu erisu commented Apr 6, 2022

Closes #133

This PR fixes rebasing issues and failing iOS tests.

@erisu erisu requested a review from breautek April 6, 2022 01:30
@erisu erisu force-pushed the feat/detect-apple-silicon branch from de74384 to 396e8c7 Compare April 6, 2022 04:09
@erisu
Copy link
Member Author

erisu commented Apr 6, 2022

@SailingSteve

I noticed your PR had additional commits that were not related to your PR. I think there was an error with the rebase.

I went ahead and created a new PR based on the latest main branch and cherry-picked your changes.

I also pushed an extra commit to fix the failing GitHub Actions iOS tests.

Your PR had the necessary @available check for iOS 14. But it was missing the ifdef block to ensure builds passed on older Xcode versions. Truthfully, I don't think people should use older versions of Xcode, for example, 11. But we needed Xcode 11 in GH Actions to access the iOS 12 and 13 simulators.

My additional change here: 8938cf7

If you want to test run this PR that would be great.
Since the other PR had some unusual changes, I will merge this PR instead and close your original PR.
Since I cherry-picked your changes, you will still be listed as an author of the commits, and your work is not lost.

@erisu erisu added the bug label Apr 6, 2022
@erisu erisu merged commit 6b09b88 into master Apr 7, 2022
@erisu erisu deleted the feat/detect-apple-silicon branch April 7, 2022 08:55
@SailingSteve
Copy link
Contributor

SailingSteve commented Apr 7, 2022

Ran the new code on Apple Silicon...

2022-04-07 13:55:31.101185-0700 We Vote[79466:3853747] Dump Object window.device available: true
2022-04-07 13:55:31.101250-0700 We Vote[79466:3853747] Dump Object window.device platform: iOS
2022-04-07 13:55:31.101299-0700 We Vote[79466:3853747] Dump Object window.device version: 15.4
2022-04-07 13:55:31.101344-0700 We Vote[79466:3853747] Dump Object window.device uuid: 881C4745-4B65-5C85-AA69-328DF8D6C9DB
2022-04-07 13:55:31.101393-0700 We Vote[79466:3853747] Dump Object window.device cordova: 6.2.0
2022-04-07 13:55:31.101438-0700 We Vote[79466:3853747] Dump Object window.device model: iPad8,6
2022-04-07 13:55:31.101503-0700 We Vote[79466:3853747] Dump Object window.device manufacturer: Apple
2022-04-07 13:55:31.101548-0700 We Vote[79466:3853747] Dump Object window.device isVirtual: false
2022-04-07 13:55:31.101586-0700 We Vote[79466:3853747] Dump Object window.device serial: unknown
2022-04-07 13:55:31.105312-0700 We Vote[79466:3853747] Dump Object window.device isiOSAppOnMac: true

and it worked perfectly.

And as expected on a iPhone simulator:

2022-04-07 14:03:48.581910-0700 We Vote[82883:3871563] Dump Object window.device available: true
2022-04-07 14:03:48.582010-0700 We Vote[82883:3871563] Dump Object window.device platform: iOS
2022-04-07 14:03:48.582145-0700 We Vote[82883:3871563] Dump Object window.device version: 15.4
2022-04-07 14:03:48.582230-0700 We Vote[82883:3871563] Dump Object window.device uuid: 3E59588E-05F1-48A9-8C88-1A2C19E653D8
2022-04-07 14:03:48.582318-0700 We Vote[82883:3871563] Dump Object window.device cordova: 6.2.0
2022-04-07 14:03:48.582397-0700 We Vote[82883:3871563] Dump Object window.device model: iPhone14,3
2022-04-07 14:03:48.582475-0700 We Vote[82883:3871563] Dump Object window.device manufacturer: Apple
2022-04-07 14:03:48.582558-0700 We Vote[82883:3871563] Dump Object window.device isVirtual: true
2022-04-07 14:03:48.582665-0700 We Vote[82883:3871563] Dump Object window.device serial: unknown
2022-04-07 14:03:48.582743-0700 We Vote[82883:3871563] Dump Object window.device isiOSAppOnMac: false

@erisu
Copy link
Member Author

erisu commented Apr 7, 2022

Thank you for confirming.

@SailingSteve
Copy link
Contributor

Thank you!

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

Successfully merging this pull request may close these issues.

3 participants