16
Views
3
Comments
[Background Mode Advanced] Cannot read properties of undefined (reading 'backgroundMode')
Question
background-mode-advanced
Mobile icon
Forge asset by Fábio Vaz
Application Type
Mobile

I am using this plugin in my mobile app and getting this error:

Cannot read properties of undefined (reading 'backgroundMode')

Any tips how to fix this?


UserImage.jpg
OTS POC

Hello Raymond Vermeer,


That error is a typical error of plugin not loaded well.

Use the 

to verify is plugin is loaded correctly.


Best Regards.

2024-06-04 08-58-09
Sakti S

Hi  Raymond Vermeer,

After adding the new plugin to your mobile application Rebuild your Application via Distribute tab or service center After tag your application to the newer version at lifetime and then test it again with New Build of application. Please share the feedback with us.

Additionally, as suggested by @OTS POC, please include a check for plugin integration before invoking the plugin or when the application is ready.

Best Regards,

Sakti Selvakumar.

2025-11-21 21-39-01
Raymond Vermeer

I added the CheckPlugin and generated the APK again.

Also added some LogMessage actions in CheckPlugin.

In the general log I see messages from LogMessage2

Why is the javascript CheckPlugin returning false?

if((typeof(cordova.plugins.backgroundMode) === "undefined"))    $parameters.IsLoaded = false;else    $parameters.IsLoaded = true;

I generated the app with MABS 10.0 and the device has this versions:

OperatingSystem: Android 9
NativeShell: 13.9.2
Cordova: 12.0.0 

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.