mobile
mobile copied to clipboard
Expo Rewrite
Back in the early days VShop was already an Expo app, but because I was adding more and more packages that requried native code, it wasn't easily possible to continue using it. Now Expo has the option to build Development Builds, which can include native code.
But why Expo?
Expo (in my opinion) is much more easy to maintain, it provides extraordinary developer tools and it doesn't include any native code in the repository, as it manages that for you so upgrading to newer versions of react native (by updating the Expo SDK) is much more simple.
Rewrite
My plan for the rewrite is that I just want to port the application to Expo and in the process bump some dependencies and swap out some with expo replacements, like react-native-video
-> expo-av
(will be replaced by expo-video
in the future).
I would like (if possible), remove all of the Google Firebase stuff (fixing https://github.com/VShopApp/mobile/issues/11). For that I would have to find a replacement for the Wishlist check (as it relies on Firebase Cloud Messaging), and Analytics.
For the Wishlist check I would use the expo-background-fetch library as it runs entirely local and doesn't require a server to send a notification to trigger the shop check. I would have to do some testing as it may cause issues on some devices because some vendors decide to just kill any app that runs in the background... (see https://dontkillmyapp.com/).
For Analytics I think PostHog is a really good option, as it has a lot of useful features, a good react native sdk, and a generous free plan.
Building the app
Building the app will be done locally. For Android we will use eas
with the --local
flag. To create an unsigned IPA we have to generate the native code and then build it through Xcode like it is currently done. This is possible with the expo prebuild
command (https://docs.expo.dev/workflow/prebuild).
Why is the apk file twice as big?
This is because of the android:extractNativeLibs option in the manifest. This is now set to false on newer sdk versions by default. With this option turned off, the native libraries are not compressed in the apk file. This sounds like a bad thing, but it actually has a few advantages. See https://stackoverflow.com/questions/42998083/setting-androidextractnativelibs-false-to-reduce-app-size