For my React Native app Hooks, I wrote some native Android code to enable the running of arbitrary commands over SSH.
I've now added the iOS side, and after some refactoring, the SSH code for both platforms is now its own library: react-native-ssh.
There are no tests and it's very light on the error handling. But I figured I'd put it out there for others to use and/or improve upon.
Gradle (the Android build system) lets you specify dependencies from Maven (Java's package repository). This meant that including the Android SSH library I needed was a single line. Nice and easy.
Installing third-party dependencies on the iOS side of things is a pain, though. First, a disclaimer: I'm by no means an iOS developer, and have only dealt with XCode and CocoaPods a handful of times.
I first tried to make my library a pod to be installed via CocoaPods, which would allow it to have its own dependencies. However, there are two problems with installing a React Native library as a pod:
After this didn't work, I decided to go with the manual installation methods listed by a few other libraries (specifically react-native-lock, thanks auth0). So as it stands, after npm-installing react-native-ssh, you have to:
Perhaps I missed something, but if I haven't, this is definitely something to be addressed for React Native.