Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I am facing issue with this package in windows system on some system when key is not available and when i try to call getItem method it's not even throwing error it will result in white screen issue. #380

Open
rohitgaidhane opened this issue Jun 19, 2023 · 1 comment

Comments

@rohitgaidhane
Copy link

rohitgaidhane commented Jun 19, 2023

"use strict";
import SInfo from "react-native-sensitive-info";

/**

  • getItem(keyToGetItem, options) will get value from given key
  • @param {string} keyToGetItem key to get the item from secure storage
  • @param {*} options Allows to select which keychain's service (iOS) and shared preferences's name (android) you can use
  • @returns {Promise} returns promise
    */
    const getItem = (keyToGetItem, options) => {
    return new Promise((resolve, reject) => {
    SInfo.getItem(keyToGetItem, options).then(
    SInfoGetItemResponse => {
    resolve(SInfoGetItemResponse);
    },
    SInfoGetItemError => {
    reject(SInfoGetItemError);
    }
    );
    });
    };

/**

  • setItem(keyToSetItem, value, options) will set value from given key
  • @param {string} keyToSetItem key to set the item in secure storage
  • @param {string} value contains value to store in secure storage
  • @param {*} options Allows to select which keychain's service (iOS) and shared preferences's name (android) you can use
  • @returns {Promise} returns promise
    */
    const setItem = (keyToSetItem, value, options) => {
    return new Promise((resolve, reject) => {
    SInfo.setItem(keyToSetItem, value, options).then(
    SInfoGetItemResponse => {
    resolve(SInfoGetItemResponse);
    },
    SInfoGetItemError => {
    reject(SInfoGetItemError);
    }
    );
    });
    };

/**

  • removeItem(keyToDelete, options) will delete value from given key
  • @param {string} keyToDelete key to delete the item from secure storage
  • @param {*} options Allows to select which keychain's service (iOS) and shared preferences's name (android) you can use
  • @returns {Promise} returns promise
    */
    const removeItem = (keyToDelete, options) => {
    return new Promise((resolve, reject) => {
    SInfo.deleteItem(keyToDelete, options).then(
    SInfoGetItemResponse => {
    resolve(SInfoGetItemResponse);
    },
    SInfoGetItemError => {
    reject(SInfoGetItemError);
    }
    );
    });
    };

export { getItem, setItem, removeItem };
code snippet
i am using "react-native-sensitive-info": "^5.5.8",

@rohitgaidhane rohitgaidhane changed the title I am facing issue with this package in windows system on some system when key is not available and when i try to remove it's not even throwing error it will result in white screen issue. I am facing issue with this package in windows system on some system when key is not available and when i try to call getItem method it's not even throwing error it will result in white screen issue. Jun 19, 2023
@stale
Copy link

stale bot commented Aug 12, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the 🚧 stale label Aug 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant