Code Monkey home page Code Monkey logo

Comments (22)

paulief avatar paulief commented on May 27, 2024 1

I just want to add to this that getItem(key) returns null on Android and undefined on iOS when no value exists at that key. Pretty minor issue, but just wanted to give a heads up to anyone looking at this.

from react-native-sensitive-info.

ricardofavero avatar ricardofavero commented on May 27, 2024 1

Thank you for letting us know. We're glad this is being helpful. Right now, we are pretty busy with other projects, but pull requests are always welcome!

from react-native-sensitive-info.

mCodex avatar mCodex commented on May 27, 2024 1

Hi guys 👋

Thanks for the report. There were no reason regressing this issue. In fact, it may have happend when I merged the keystore branch within the master branch, because the keystore branch had many differences in android's files and this fix wasn't included there.

So, we should only open a new PR for that using the master branch again. I may have do this later, however feel free doing that.

from react-native-sensitive-info.

m-ueta avatar m-ueta commented on May 27, 2024 1

The issue still exists in v6.0.0-alpha.9.

For now, I decided not to use getAllItems.

from react-native-sensitive-info.

AlanFoster avatar AlanFoster commented on May 27, 2024

@randycoulman I assume the iOS API should align with android's API in this case?

from react-native-sensitive-info.

randycoulman avatar randycoulman commented on May 27, 2024

I'd probably go the other way and make them both like the iOS API. That way, we'd be adding information to the Android API rather than removing information from the iOS API. Either way, it's going to be a breaking change somewhere.

from react-native-sensitive-info.

YPCrumble avatar YPCrumble commented on May 27, 2024

Thanks for building this library! Experiencing the same issue. If we're fixing the return values, shouldn't the iOS return value be one array rather than a nested array, i.e., return:

[
    { service: 'app', key: 'foo', value: 'bar' },
    { service: 'app', key: 'baz', value: 'quux' }
]

rather than

[
  [
    { service: 'app', key: 'foo', value: 'bar' },
    { service: 'app', key: 'baz', value: 'quux' }
  ]
]

Happy to work on a PR for that if it's helpful. I don't have as much experience with Android React-Native so probably wouldn't be as helpful with reworking that section.

from react-native-sensitive-info.

randycoulman avatar randycoulman commented on May 27, 2024

@YPCrumble Yes, I agree with you. I forgot about the nested array in my earlier response.

So, my (non-authoritative) opinion is that we should return an array of objects, where the objects have the service, key, and value keys in it.

from react-native-sensitive-info.

mCodex avatar mCodex commented on May 27, 2024

Hello guys, sorry for delaying the answer once again. I'll take a look in android in this week. About iOS, I'm afraid I wouldn't because I don't have macOS available.

from react-native-sensitive-info.

illright avatar illright commented on May 27, 2024

Moreover, the example in the README is a bit misleading. From looking at it, I expected values to be an array, and have been cracking my head over this.
It would be nice to have an example output for each command, as well as return type, etc.

from react-native-sensitive-info.

mromarreyes avatar mromarreyes commented on May 27, 2024

Has this been resolved?

from react-native-sensitive-info.

SamRaymer avatar SamRaymer commented on May 27, 2024

opened a PR for this at #168

from react-native-sensitive-info.

stale avatar stale commented on May 27, 2024

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.

from react-native-sensitive-info.

stale avatar stale commented on May 27, 2024

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.

from react-native-sensitive-info.

sasurau4 avatar sasurau4 commented on May 27, 2024

I find the issue still exist because v6.0.0-alpha.5 doesn't contain #168. It's still use WritableMap and same for master branch https://github.com/mCodex/react-native-sensitive-info/blob/master/android/src/main/java/dev/mcodex/RNSensitiveInfoModule.java#L241 .
Something wrong happened in release process?

from react-native-sensitive-info.

stale avatar stale commented on May 27, 2024

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.

from react-native-sensitive-info.

mikewoudenberg avatar mikewoudenberg commented on May 27, 2024

The issue still exists in v6.0.0-alpha.6.

from react-native-sensitive-info.

stale avatar stale commented on May 27, 2024

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.

from react-native-sensitive-info.

hapablap21 avatar hapablap21 commented on May 27, 2024

It looks like #214 stepped on this fix from #168
Is there a reason that this was regressed?

from react-native-sensitive-info.

jmalStorm avatar jmalStorm commented on May 27, 2024

I am still having this issue. Wasn't this fixed?

from react-native-sensitive-info.

ingvardm avatar ingvardm commented on May 27, 2024

const RNSIResponseNormal: SensitiveInfoEntry[] | [SensitiveInfoEntry[]] = APP_FLAGS.isIOS
? RNSIResponse[0]
: RNSIResponse

from react-native-sensitive-info.

Matiassimone avatar Matiassimone commented on May 27, 2024

Hey! its a simple hotFix,
but you can use the follow workaround to solve this problem :

export const getAllSecureItem = async () => {
  try {
    const allSecureItems = await SInfo.getAllItems({
      sharedPreferencesName,
      keychainService,
    });

    return Platform.OS === 'ios'
      ? allSecureItems[0]
      : Object.entries(allSecureItems)?.map((secureItem) => {
          const [key, value] = secureItem;
          return { key: key, value: value };
        });
        
  } catch (e) {
    // Error handler here.
  }
};

This function return a simple Array of Secure Items:
[ { key: "", value: "" }, { key: "", value: "" } ]

@m-ueta @randycoulman

from react-native-sensitive-info.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.