iOS上的Expo SecureStore无法从iCloud钥匙串获取数据

问题描述

我目前有2个应用程序(1个iOS,1个MacOS)通过iCloud钥匙串共享一些数据。设置方法如下。

App 1 (iOS):
bundle id: com.appios
KeyChain Groups (Signing & Capabilities): com.aaaa
KeyChain Sevice: com.bbbb
Key: ccc

App 2 (MacOS):
bundle id: com.appmacos
KeyChain Groups (Signing & Capabilities): com.aaaa
KeyChain Sevice: com.bbbb
Key: ccc

,并且有效。现在,我想使用ReactNative创建App 3并读取相同的数据,因此我使用了Expo's SecureStore,希望可以解决这个问题。

我已经在Xcode中设置了

App 3 (iOS-ReactNative):
bundle id: com.apprn
KeyChain Groups (Signing & Capabilities): com.aaaa

这是我最基本的实现:

import * as SecureStore from 'expo-secure-store';

SecureStore.getItemAsync('cccc',{
  keychainService:'com.bbbb'
})
  .then(value => console.log(value))
  .catch(err => console.log(err))

我已经在安装了其他iOS应用(应用1)的真实设备上进行了测试,但是getItemAsync始终返回null

我做错什么了吗?这甚至可行吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)