Customized dialog alerting the user of the battery save mode 'Protected Apps' of Huawei smartphones
npm install react-native-huawei-protected-appsThis Module cannot detect if the user has already enabled protected mode for the app. The dialog will be shown under the following conditions:
1. intent 'com.huawei.systemmanager/com.huawei.systemmanager.optimize.process.ProtectActivity' is callable
2. "Do not show again" checkbox hasn't been checked yet
It is not necessary to check for ``Platform.OS === 'android'` as the module wrapper does this for you already
``
npm install --save react-native-huawei-protected-apps@latest
react-native link react-native-huawei-protected-apps
Usage
`javascript
import HuaweiProtectedApps from 'react-native-huawei-protected-apps';
const config = {
title: "Huawei Protected Apps",
text: "This app requires to be enabled in 'Protected Apps' in order to receive push notifcations",
doNotShowAgainText: "Do not show again",
positiveText: "PROTECTED APPS",
negativeText: "CANCEL"
};
HuaweiProtectedApps.AlertIfHuaweiDevice(config);
``
