[TIMOB-25885] Windows: Add "Ti.Platform.ostype" support
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | Low |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2018-03-19T22:42:09.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Windows |
Labels | architecture, windows |
Reporter | Joshua Quick |
Assignee | Kota Iguchi |
Created | 2018-03-19T21:14:39.000+0000 |
Updated | 2018-03-19T22:42:09.000+0000 |
Description
*Summary:*
On Windows, the
Ti.Platform.ostype
property returns an empty string.
[PlatformModule.cpp#L100](https://github.com/appcelerator/titanium_mobile_windows/blob/7b0db6e247c1662c535b2e4bd3f0c141ae95a5a0/Source/TitaniumKit/src/PlatformModule.cpp#L100)
It should return one of the following to match Android and iOS' behavior:
* "32bit"
* "64bit"
It's okay to make the 32-bit or 64-bit determination based on the app you're running instead of the architecture of the OS. This is how it's done on iOS.
[APSUtility.m#L15](https://github.com/appcelerator/aps_sdk/blob/195633dd10a37d96ecf52be35c0c712dff5ef331/ios/support/analytics/APSAnalytics/APSUtility.m#L15)
*Note:*
The APS library provides CPU architecture (ex: "arm", "x86", etc.) for "ostype" when recording analytics. This does not match Android and iOS' behavior. We should not duplicate this issue on the Titanium side.
Also note that I'm bringing this up because Android is currently/wrongly hard-coded to return "32bit" and we have a customer who wants to correctly identify the platform as shown here: [TIMOB-25877]
Same as TIMOB-25884, the Windows implementation is here https://github.com/appcelerator/titanium_mobile_windows/blob/7b0db6e247c1662c535b2e4bd3f0c141ae95a5a0/Source/Ti/src/Platform.cpp#L292-L304
Oh shoot. Well if this is the case, then we can close this ticket out.
Already implemented.