realm / realm-object-server

Tracking of issues related to the Realm Object Server and other general issues not related to the specific SDK's
https://realm.io
293 stars 42 forks source link

React native: Unable to access Realm on app groups iOS. #361

Closed vsridharan6 closed 6 years ago

vsridharan6 commented 6 years ago

Goals

I am trying to use Realm on my iOS project, and React Native project. The realm is stored in our App Groups. When we try to access the Realm from the javascript side, we are not able to access the shared group.

Expected Results

// we get the realm db path from the native modules. this.REALM_DB_PATH = NativeModules.RealmHelperModule.realmDBPath;

const config = {schema: [SomeSchema], path: this.REALM_DB_PATH}; const realm = new Realm(config); console.log(realm.path);

Expected result:

file:///Users/kira/Library/Developer/CoreSimulator/Devices/98C4E7E8-9E45-4A17-824C-3D80D9207A43/data/Containers/Shared/AppGroup/37915G54-BA5B-4E08-AE7E-DCE7668B5711/RealmDB.realm

Actual Results

file:///Users/kira/Library/Developer/CoreSimulator/Devices/98C4E7E8-9E45-4A17-824C-3D80D9207A43/data/Containers/Data/Application/47896D45-4EC9-44EA-8069-442276621B35/Documents/file:///Users/kira/Library/Developer/CoreSimulator/Devices/98C4E7E8-9E45-4A17-824C-3D80D9207A43/data/Containers/Shared/AppGroup/37915G54-BA5B-4E08-AE7E-DCE7668B5711/RealmDB.realm

Steps to Reproduce

  1. Save Realm on App Groups on Native.
  2. Access Realm on React Native. Get the path from a native module.

Code Sample

Version of Realm and Tooling

NodeJS-realm = 2.2.x; NodeJS-react-native = 0.50.x;

Logs

systemctl status realm-object-server.service Paste output here
sudo journalctl -u realm-object-server.service Paste output here
cat /var/log/realm-object-server.log Paste output here