コード例 #1
0
const handleAuthentication = async (vendor) => {
    app.setPerformingEMMAuthentication(true);
    const isSecured = await mattermostManaged.isDeviceSecure();

    const translations = app.getTranslations();
    if (isSecured) {
        try {
            mattermostBucket.setPreference('emm', vendor, LocalConfig.AppGroupId);
            await mattermostManaged.authenticate({
                reason: translations[t('mobile.managed.secured_by')].replace('{vendor}', vendor),
                fallbackToPasscode: true,
                suppressEnterPassword: true,
            });
        } catch (err) {
            mattermostManaged.quitApp();
            return false;
        }
    }

    app.setPerformingEMMAuthentication(false);
    return true;
};
コード例 #2
0
 onPress: () => {
     mattermostManaged.quitApp();
 },