MCPcopy Create free account
hub / github.com/transistorsoft/react-native-background-geolocation / validateConfig

Function validateConfig

src/NativeModule.js:127–153  ·  view source on GitHub ↗
(config)

Source from the content-addressed store, hash-verified

125
126// Validate provided config for #ready, #setConfig
127const validateConfig = (config) => {
128 // Detect obsolete notification* fields and re-map to Notification instance.
129 if (
130 (config.notificationPriority) ||
131 (config.notificationText) ||
132 (config.notificationTitle) ||
133 (config.notificationChannelName) ||
134 (config.notificationColor) ||
135 (config.notificationSmallIcon) ||
136 (config.notificationLargeIcon)
137 ) {
138 console.warn('[BackgroundGeolocation] WARNING: Config.notification* fields (eg: notificationText) are all deprecated in favor of notification: {title: "My Title", text: "My Text"} See docs for "Notification" class');
139 config.notification = {
140 text: config.notificationText,
141 title: config.notificationTitle,
142 color: config.notificationColor,
143 channelName: config.notificationChannelName,
144 smallIcon: config.notificationSmallIcon,
145 largeIcon: config.notificationLargeIcon,
146 priority: config.notificationPriority
147 };
148 }
149
150 config = TransistorAuthorizationService.applyIf(config);
151
152 return config;
153};
154
155// Cached copy of DeviceInfo.
156let deviceInfo = null;

Callers 4

readyMethod · 0.85
configureMethod · 0.85
setConfigMethod · 0.85
resetMethod · 0.85

Calls 2

applyIfMethod · 0.80
warnMethod · 0.65

Tested by

no test coverage detected