forked from Taylor123/react-native-widget-center
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
25 lines (20 loc) · 706 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { NativeModules, Platform } from 'react-native';
const { RNWidgetCenter } = NativeModules;
export default class WidgetCenter {
static widgetCenterSupported = Platform.OS === 'ios' && Platform.Version >= 14;
static reloadTimelines = kind => {
if (WidgetCenter.widgetCenterSupported) {
RNWidgetCenter.reloadTimelines(kind)
}
}
static reloadAllTimelines = () => {
if (WidgetCenter.widgetCenterSupported) {
RNWidgetCenter.reloadAllTimelines()
}
}
static getCurrentConfigurations = () => {
if (WidgetCenter.widgetCenterSupported) {
return RNWidgetCenter.getCurrentConfigurations()
}
}
}