---
# System prepended metadata

title: 'React Native native module lib - Sat 1st Nov, 2020'
tags: [nativemodules, bob, programmingjournal, '2020', deviceuptime]

---

# React Native native module lib - Sat 1st Nov, 2020

I created [a small React Native library](https://www.npmjs.com/package/react-native-device-uptime) this weekend to tell you the iOS or Android system uptime.

I need this information for a project, and I was unable to find any existing libraries to provide it, so I decided to write my own and open-source it!

This was my first "npm package" native library, and it was interesting putting it together!

I used [react-native-bob](https://github.com/callstack/react-native-builder-bob) to bootstrap the whole thing. It's an excellent (if opinionated tool) for quickly getting going creating a native integration.

You can make changes to your base index and iOS/Android folders, then run the `example` app to see them working. It's also a good idea to open the iOS and Android example app folders in Xcode and Android Studio respectively.

The [Android](https://reactnative.dev/docs/native-modules-android) and [iOS](https://reactnative.dev/docs/native-modules-ios) React Native native module docs were a great help.

I wrote the iOS integration in objective-c, but next time will use Swift.

Overall, it was an interesting and useful exercise for me! I want to do more in the future to deepen my iOS and Android knowledge!

###### tags: `programmingjournal` `2020` `nativemodules` `bob` `deviceuptime`