Skip to main content
Version: v0.3.x

React Native

The setup for React Native is rather different than Node.js. We do not have to install dependencies on the host-platform, but for the build target. This would be the indy-sdk for Android and iOS.

Known Errors

Add setup of external storage permissions (Android)

If you find the following error when using this package:

2020-01-27 16:25:02.300 9955-10044/com.usereactnativeindysdk E/log_panics: thread 'unnamed' panicked at 'called `Result::unwrap()` on an `Err` value: Os { code: 13, kind: PermissionDenied, message: "Permission denied" }': libcore/result.rs:945

Modify onCreate method in MainActivity of your project where you want to use this library in a following way:

public class MainActivity extends ReactActivity {
...
@Override
protected void onCreate(Bundle savedInstanceState) {
...
File externalFilesDir = getExternalFilesDir(null);
String path = externalFilesDir.getAbsolutePath();
System.out.println("externalFilesDir=" + path);

try {
Os.setenv("EXTERNAL_STORAGE", path, true);
} catch (ErrnoException e) {
e.printStackTrace();
}
...
}
...
}

This should resolve the issue with permissions.