Fix platform version checking

Fix bug where `widgetCenterSupported` is false whenever the platform version cannot be cast to a number, i.e. `14.4.2`.
This commit is contained in:
Brodie 2021-06-01 09:40:30 +10:00 committed by Taylor Johnson
parent 774f11f1c6
commit 269004c08f

View File

@ -3,7 +3,7 @@ import { NativeModules, Platform } from 'react-native';
const { RNWidgetCenter } = NativeModules;
export default class WidgetCenter {
static widgetCenterSupported = Platform.OS === 'ios' && Platform.Version >= 14;
static widgetCenterSupported = Platform.OS === 'ios' && Platform.Version.split('.')[0] >= 14;
static reloadTimelines = kind => {
if (WidgetCenter.widgetCenterSupported) {