mariusbackes / cordova-plugin-theme-detection

:black_circle: :white_circle: :iphone: Cordova plugin to detect whether dark mode is enabled or not
24 stars 14 forks source link

ThemeDetection of undefined #10

Open mkden opened 3 years ago

mkden commented 3 years ago

install to cordova this plugin add to config <plugin name="cordova-plugin-theme-detection" spec="1.3.0" /> but not work erorr ThemeDetection of undefined

my cod

cordova.plugins.ThemeDetection.isAvailable((res)=>{
  console.log('Is Theme Detection Available? ->',res);
},(err)=>{
  console.log('Error when running isAvailable ->',err);
});

cordova.plugins.ThemeDetection.isDarkModeEnabled((res)=>{
  console.log('Is it dark mode? ->',res);
},(err)=>{
  console.log('Error when running isDarkModeEnabled  ->',err);
});
mariusbackes commented 3 years ago

Did you try to install the plugin with the cordova CLI? cordova plugin add cordova-plugin-theme-detection

mkden commented 3 years ago

1) cordova plugin add cordova-plugin-theme-detection 2)the plugin was installed and appeared in the plugins folder 3)add to config <plugin name="cordova-plugin-theme-detection" spec="1.3.0" /> 4)add to index.html code `cordova.plugins.ThemeDetection.isAvailable((res)=>{ console.log('Is Theme Detection Available? ->',res); },(err)=>{ console.log('Error when running isAvailable ->',err); });

cordova.plugins.ThemeDetection.isDarkModeEnabled((res)=>{ console.log('Is it dark mode? ->',res); },(err)=>{ console.lo`

but not work erorr ThemeDetection of undefined

mkden commented 3 years ago

test in Monaca Debugger

mariusbackes commented 3 years ago

Please try to reinstall the plugin or readd your platform. I'm not able to reproduce this issue

SimeonLukas commented 3 years ago

Is there a problem with MIUI? Beacuse i have the same Issue.

mariusbackes commented 3 years ago

It shouldn't be a problem with MIUI, I'm testing on a Xiaomi device, too. Are you guys using any plugin for app development?

alanmilinovic commented 3 months ago

After switching from SDK 33 to SDK 34 I got this error and plugin is not working any longer.

This is what I have: Cordova android 12.0.1 android-targetSDKVersion=34 android-minSdkVersion=30 android-compileSdkVersion=34