This Cordova plugin alerts configuration requirements of your Android app and then opens the related settings, e.g. Protected Apps in Huawei devices. The plugin is also compatible with PhoneGap Build.
- Android
cordova.plugins.ConfigAlert.alert();
cordova.plugins.ConfigAlert.alert({
title: "Huawei Protected Apps",
message: "This app requires to be enabled in 'Protected Apps' to function properly.",
ok: "Protected Apps",
cancel: "Remind",
package: "com.huawei.systemmanager",
class: "com.huawei.systemmanager.optimize.process.ProtectActivity",
force: false, // force alert, ignoring user selection and value of SharedPreference
key: "skipAlerts", // key to SharedPreference
allPowerSavers: false // alert all known power savers
});
The plugin can either be installed from git repository, from local file system through the Command-line Interface or cloud based through PhoneGap Build.
From master:
# ~~ from master branch ~~
cordova plugin add https://github.com/ToniKorin/cordova-plugin-config-alert.git
from a local folder:
# ~~ local folder ~~
cordova plugin add cordova-plugin-config-alert --searchpath path
or to use the latest stable version:
# ~~ stable version ~~
cordova plugin add [email protected]
To remove the plug-in, run the following command:
cordova plugin rm cordova-plugin-config-alert
Add the following xml line to your config.xml:
<gap:plugin platform="android" name="cordova-plugin-config-alert" version="1.x.x" source="npm"/>
Check the Change Log.
This software is released under the Apache 2.0 License.
© 2016 Toni Korin