n-aggarwal/privacy-messaging-app

IOS Keystore Warning

Closed this issue · 1 comments

As soon as I register an account on my iOS virtual device, I get the following warning:
Possible Unhandled Promise Rejection (id: 0):
Error: An exception was thrown while calling ExpoSecureStore.setValueWithKeyAsync

Need to fix this to make the app work on IOS.

The issue occurs because of "SecureStore.WHEN_UNLOCKED" parameter I think.

So, Android and IOS need to have separate implementations:

import { Platform } from "react-native";

if (Platform.OS === "ios") {
  // do something if the device is iOS
} else if (Platform.OS === "android") {
  // do something if the device is Android
} else {
  // do something if the device is neither iOS nor Android
}