From 419e78b48b99b9cdc82e50eee0b72df3e2c06b6e Mon Sep 17 00:00:00 2001 From: onurkilic Date: Fri, 13 Sep 2024 00:15:41 +0300 Subject: [PATCH] Added empty methods to silence NativeEventEmitter warnings --- SystemSetting.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/SystemSetting.js b/SystemSetting.js index d6cdd11..d631b35 100644 --- a/SystemSetting.js +++ b/SystemSetting.js @@ -4,6 +4,14 @@ import Utils from './Utils' const SystemSettingNative = NativeModules.SystemSetting +SystemSettingNative.removeListeners = () => { + // This is a placeholder implementation +} + +SystemSettingNative.addListener = () => { + // This is a placeholder implementation +} + const SCREEN_BRIGHTNESS_MODE_UNKNOW = -1 const SCREEN_BRIGHTNESS_MODE_MANUAL = 0 const SCREEN_BRIGHTNESS_MODE_AUTOMATIC = 1 @@ -207,12 +215,12 @@ export default class SystemSetting { if (supported) await Linking.openURL(settingsLink); break; } - case 'android': + case 'android': await SystemSettingNative.openAppSystemSettings() break; default: throw new Error('unknown platform') - break; + break; } } @@ -268,4 +276,4 @@ export default class SystemSetting { complete() }) } -} \ No newline at end of file +}