Advanced

Native Modules and Platform APIs

Write your own native module with the Expo Modules API — a small Swift/Kotlin function exposed to JavaScript — for functionality no existing package covers.

~6h
0 / 6 steps
🚀
Intro

Before We Start

Prerequisites: completed at least one prior project in this roadmap, Xcode installed (for iOS) and/or Android Studio (for Android), basic familiarity with Swift or Kotlin syntax is helpful but not required.

Version note: verified against current Expo documentation as of July 2026: the Expo Modules API (create-expo-module) is the current, actively recommended way to write native modules for both Expo and bare React Native apps — it replaced the older native-modules approach of manually writing Objective-C/Java bridging code. As of Expo SDK 56, modules can additionally be defined inline within a project (not just as a separate package), but this project uses the standalone create-expo-module@latest flow since it's the more broadly documented and stable path. A development build (not Expo Go) is required to test any custom native module.

The Expo SDK and community packages cover most native functionality, but eventually you'll hit something they don't: a proprietary SDK, an obscure platform API, or logic that's simply faster in native code. The Expo Modules API exists for exactly this — a declarative Swift/Kotlin DSL that handles the JavaScript-to-native bridge, type coercion, and autolinking for you, so writing a native module looks a lot more like writing a small class than wiring up C++ or JNI by hand. This project builds a real one: a module that reads the device's battery level natively and exposes it to JavaScript as a typed async function.

🔨

Scaffold a module

🔨

Implement the iOS side in Swift and the Android side in Kotlin

🔨

Call it from JavaScript

🎯
Secret Mission

Secret Mission: Expose a native event, not just a function

🧹
Wrap Up

Before You Go

Pro

Test what you just learned

Self-testing is one of the best ways to retain new skills. Unlock project quizzes to check your understanding.

Log in to unlock