react-native-sensitive-info: getAllItems() return value inconsistent on different platforms
Thanks for this library! It’s been super-helpful for us.
We noticed that the getAllItems()
function resolves the promise with different data types on iOS vs Android.
On iOS, we get back an array that contains another array. The inner array has objects with the keys service
, key
, and value
:
[
[
{ service: 'app', key: 'foo', value: 'bar' },
{ service: 'app', key: 'baz', value: 'quux' }
]
]
On Android, we get back an object that just has keys and values:
{
foo: 'bar',
baz: 'quux'
}
This inconsistency makes it difficult to use the results in a cross-platform way.
About this issue
- Original URL
- State: open
- Created 8 years ago
- Reactions: 12
- Comments: 22 (5 by maintainers)
Commits related to this issue
- Merge pull request #8 from evollu/auth-error-cde return error code auth fail — committed to mCodex/react-native-sensitive-info by deleted user 7 years ago
The issue still exists in v6.0.0-alpha.9.
For now, I decided not to use getAllItems.
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.
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!
I just want to add to this that
getItem(key)
returnsnull
on Android andundefined
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.