{ "id": "175390", "key": "TIMOB-28061", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "21051", "description": "", "name": "Release 9.2.0", "archived": false, "released": true, "releaseDate": "2020-09-23" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2020-08-18T15:28:57.000+0000", "created": "2020-08-01T03:33:55.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "android", "iOS", "os", "platform", "version" ], "versions": [], "issuelinks": [ { "id": "58676", "type": { "id": "10001", "name": "Cloners", "inward": "is cloned into", "outward": "is cloned from" }, "inwardIssue": { "id": "175479", "key": "TIMOB-28098", "fields": { "summary": "TiAPI: Add OS version patch integer constants", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "priority": { "name": "Low", "id": "4" }, "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false } } } } ], "assignee": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2020-08-26T14:38:47.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" }, { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "*Summary:*\r\nCurrently, you can only fetch the OS version as a string via the [Ti.Platform.version|https://docs.appcelerator.com/platform/latest/#!/api/Titanium.Platform-property-version] property. This is not convenient to use when you only want to call APIs on higher OS versions. For example, we've seen a lot of code that looks like the below.\r\n\r\n{code:javascript}\r\nif (OS_IOS && parseInt(Ti.Platform.version.split('.')[0]) >= 13) {\r\n\t// Do something on iOS 13 or higher...\r\n}\r\n{code}\r\n\r\n*Feature Proposal:*\r\nAdd the following properties to {{Ti.Platform}}...\r\n* {{Ti.Platform.versionMajor}} // Returns an integer.\r\n* {{Ti.Platform.versionMinor}} // Returns an integer.\r\n\r\nAlso add the following global constants.\r\n_(These will pair well with [OS_ANDROID|https://docs.appcelerator.com/platform/latest/#!/api/Global-property-OS_ANDROID] and [OS_IOS|https://docs.appcelerator.com/platform/latest/#!/api/Global-property-OS_IOS].)_\r\n* {{OS_VERSION_MAJOR}}\r\n* {{OS_VERSION_MINOR}}\r\n\r\nThis will make the above code example look simpler like this...\r\n{code:javascript}\r\nif (OS_IOS && (OS_VERSION_MAJOR >= 13)) {\r\n\t// Do something on iOS 13 or higher...\r\n}\r\n{code}\r\n\r\n*Note:*\r\nOn Android, we have a [Ti.Platform.Android.API_LEVEL|https://docs.appcelerator.com/platform/latest/#!/api/Titanium.Platform.Android-property-API_LEVEL] constant which is a single integer used to represent all Android OS versions. It's best to use this if you can, but note that no other platform has a similar concept... while all operating system support a {{.}} version that we can use for parity.\r\nhttps://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels\r\n", "attachment": [], "flagged": false, "summary": "TiAPI: Add OS version major/minor integer constants", "creator": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "456322", "author": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR (master): https://github.com/appcelerator/titanium_mobile/pull/11859", "updateAuthor": { "name": "jquick", "key": "jquick", "displayName": "Joshua Quick", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-08-01T05:32:46.000+0000", "updated": "2020-08-01T05:32:46.000+0000" }, { "id": "456350", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "merged to master for 9.2.0 target. Auto-backport PR for 9_3_X is in-process: https://github.com/appcelerator/titanium_mobile/pull/11869", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2020-08-05T20:33:16.000+0000", "updated": "2020-08-05T20:33:16.000+0000" }, { "id": "456504", "author": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed, Tested using the test case mentioned in this PR https://github.com/appcelerator/titanium_mobile/pull/11859 tested in with the SDK versions {{9.2.0.v20200814104443}} and {{9.3.0.v20200814072212}}.\r\n\r\nTest and other information can be found at: \r\nhttps://github.com/appcelerator/titanium_mobile/pull/11859\r\nhttps://github.com/appcelerator/titanium_mobile/pull/11869\r\n\r\n*Test Environment*\r\n{code:java}\r\nMacOS Big Sur: 11.0 Beta 4\r\nXcode: 12.0 Beta 4 \r\nJava Version: 1.8.0_242\r\nAndroid NDK: 21.3.6528147\r\nNode.js: 12.18.1\r\n\"\"NPM\":\"5.0.0\",\"CLI\":\"8.1.0-master.11\"\"\r\niphone 8 Sim (14.0 Beta)\r\nAPI29 Pixel XL emulator\r\n{code}", "updateAuthor": { "name": "smohammed", "key": "smohammed", "displayName": "Samir Mohammed", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-08-18T15:28:46.000+0000", "updated": "2020-08-18T15:28:46.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }