You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On iOS 16.0: 160
On iOS 16.0.1: 1601
On iOS 16.0.10 (hypothetical): 16010
Platform(s)
iOS
Current Behavior
The problem is that iOSVersion simply removes the dots and joins the integers together. This breaks comparison and sorting. For example, 16.0.1 would sort higher than 16.1 because 1601 > 161. It also ignores the fact that minor and patch versions may have more than one digit (It happened before, see: iOS 4.2.10).
Expected Behavior
I suggest two changes:
1- Set minor and patch versions to 0 if they don't exist in systemVersion.
2- Pad minor and patch versions to two digits.
On iOS 16.0: 160000
On iOS 16.0.1: 160001
On iOS 16.0.10 (hypothetical): 160010
Code Reproduction
Other Technical Details
Additional Context
The text was updated successfully, but these errors were encountered:
Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of the plugin, please create a new issue and ensure the template is fully filled out.
Bug Report
Plugin(s)
Device plugin
Capacitor Version
This code was just committed recently and not released yet, but I thought I'd report the issue now so there would be no breaking change after release.
capacitor-plugins/device/ios/Plugin/Device.swift
Lines 82 to 88 in 2ceb296
Platform(s)
iOS
Current Behavior
The problem is that iOSVersion simply removes the dots and joins the integers together. This breaks comparison and sorting. For example, 16.0.1 would sort higher than 16.1 because 1601 > 161. It also ignores the fact that minor and patch versions may have more than one digit (It happened before, see: iOS 4.2.10).
Expected Behavior
I suggest two changes:
1- Set minor and patch versions to 0 if they don't exist in systemVersion.
2- Pad minor and patch versions to two digits.
Code Reproduction
Other Technical Details
Additional Context
The text was updated successfully, but these errors were encountered: