erisu edited a comment on pull request #133:
URL: 
https://github.com/apache/cordova-plugin-device/pull/133#issuecomment-711471219


   I personally don't see what is the need of this new property.
   
   I feel that using both the `device.model` and `device.platform` together 
should be enough to identify if the iOS app is running on a macOS and on which 
architecture.
   
   To recap from what I am reading and understanding from the documentation 
written in the repo's README,
   
   The `device.platform` should return either `iOS` or `Mac OS X`. Since we are 
talking about building an iOS app, which means we are using the Cordova iOS 
platform, `iOS` will always be returned. This value is hardcoded 
[here](https://github.com/apache/cordova-plugin-device/blob/master/src/ios/CDVDevice.m#L91).
   
   The `device.model` should return one of the following two cases depending on 
the device's hardware information:
   
   ```
   // iOS:     for the iPad Mini, returns iPad2,5; iPhone 5 is iPhone 5,1
   // OSX:                        returns "x86_64"
   ```
   
   From the Cordova iOS related source code, I am expecting to see either the 
simulator's model identifier or the hardware machine which is one of the two 
items above. When running a quick playground test on a macOS, the value 
`x86_64` is returned.
   
   Basically, I am expecting to see `iOS` platform on a `x86_64` model when 
running on a macOS. I suspect on an Apple Silicon, it would say `iOS` platform 
on an `ARM64` model.
   
   I personally think using these two properties combined is enough to know if 
the app is running on a mac.
   
   Can it be explained why we need to introduce a new property instead of using 
these two existing properties which already exist and is something that can be 
used by multiple platforms?


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to