n-aggarwal / privacy-messaging-app

This repository contains the code for the final project developed for COMP360: Information Security and Privacy.
0 stars 0 forks source link

IOS Keystore Warning #27

Closed n-aggarwal closed 1 year ago

n-aggarwal commented 1 year ago

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.

n-aggarwal commented 1 year ago

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
}