小编Jux*_*ure的帖子

离子安全存储 - 要求用户设置锁定屏幕

我正在尝试初始化安全存储插件.当此失败时,表示用户没有安全的锁屏设置.使用github页面我正在尝试重新创建提供的示例:

var ss;
var _init = function () {
    ss = new cordova.plugins.SecureStorage(
        function () {
            console.log('OK');
        },
        function () {
            navigator.notification.alert(
                'Please enable the screen lock on your device. This app cannot operate securely without it.',
                function () {
                    ss.secureDevice(
                        function () {
                            _init();
                        },
                        function () {
                            _init();
                        }
                    );
                },
                'Screen lock is disabled'
            );
        },
        'my_app');
};
_init();
Run Code Online (Sandbox Code Playgroud)

这是我的尝试:

private createSecureStorage() {
    this.secureStorageAPI.create(this.storeName).then( 
        (storage: SecureStorageObject) => {
            this.secureStorage = storage;
    }).catch( 
        (error) => {
            this.dialogs.alert( 'Please …
Run Code Online (Sandbox Code Playgroud)

javascript typescript ionic2 ionic-native

6
推荐指数
1
解决办法
1513
查看次数

标签 统计

ionic-native ×1

ionic2 ×1

javascript ×1

typescript ×1