Experimenting with new awesome React Native + Expo features.
Work in progress. More info soon.
A preview video (click the image):
⚠️ Caution! Many features used in this demo are in early, experimental stage and they're not ready for production. Use on your own risk.
- Uses Expo custom managed workflow. Prebuilds on Expo SDK 43 pre-alpha template.
- All native changes (even these unusual) and patches are covered with config plugins and yarn
postinstall
script. - Uses Expo Dev Client, react-navigation, ui-kitten
- Bluetooth communication using react-native-ble-plx with config plugin
- Color picker using Expo GL, made from this tutorial from William Candillon, but rewritten to Reanimated v2
- Music Picker is an expo-module written using Swift "Sweet" API. More info soon.
- JSI real-time Audio streaming, taken from this PR, thank you Marc!
- Player controls stolen from NCL (internal Expo rn-tester equivalent).
- FFT is calculated in the JS thread. The spectrum bin heights are written to
SharedValue
s and animated with Reanimated 2.There is plan to use react-native-multithreading and calculate it in a separate thread. But even without that, the JS keeps around 57-59 fps.
- Hardware: Arduino Uno and the HM-10 BLE 4.0 module. Read more in the Hardware README.
First time:
- Make sure you have Expo and all the stuff installed and configured (including Xcode)
yarn install
yarn prebuild
- Copy
AppDelegate.m
frompatches
dir toios/expomegademo
directory - see below why. yarn run:ios
Just to start the bundler (without rebuilding client): run yarn start
.
Most of them are caused by using very early SDK 43 stuff, which is not yet published, and other published packages are not yet compatible.
expo-dev-client
config plugin is not yet working with SDK 43 alpha.- It hangs the CLI for Android at the
dangerousMod -> Main Activity
so the-p ios
must be added to the prebuild command. - It messes up the
AppDelegate.m
. Workign version can be found in./patches/AppDelegate.m
- need to be copied manually.
- It hangs the CLI for Android at the
- Frequency bin labels are wrong 🤷. I needed to display them in log scale and I am too lazy to think about how to recalculate everything properly.
- Modifying the
sound.onAudioSampleReceived
callback and the Reanimated 2 stuff requires at least picking the song again to reload properly, sometimes whole app restart is needed. - Does not work on emulator.
- Not yet works for Android
- No JSI-related
expo-av
changes applied. - The MusicPicker module isn't implemented yet for that platform (there's a copy-pasted
expo-haptics
code ¯_(ツ)_/¯)
- No JSI-related
See the postinstall.js
script and the plugins
section of app.json
to see how the patches are applied
- patch-package for
expo-gl
and related libraries - needed, because of migration from@unimodules/core
toexpo-modules-core
- new
expo-modules-autolinking
requires modules to be specified inpackage.json
dependencies. I don't want to copy my custom native modules tonode_modules
they are deleted after being copied there by yarn. - by default, expo modules are built with
xcframework
if available, but that does not work for patchedexpo-gl
, so itsxcframework
is deleted force build from source. expo-gl
installs wrongexpo-modules-core
dependency in its ownnode_modules
- it is deleted, the globalnode_modules
one is correct.expo-cli
built-in plugins sets thePush Notifications
capability even whenexpo-notifications
are not installed and I see no way to disable it. Another plugin was written to delete that entitlement.- iOS requires another
Info.plist
value aboutMedia Library usage permission
- a config plugin takes care of that - The
custom_native_modules
directory needs to be added to autolinking paths inPodfile
. A config plugin takes care of that. - The
AppDelegate.m
is being broken byexpo-dev-client
config plugin,wrote another config plugin to copy the patched file- it does not work, still need to copy it manually.