SDK Version: 37+
Platforms: Android and iOS
I asked this question on [Reddit] as well so reading it there may provide more information if there’s something about this question that you don’t understand.(https://www.reddit.com/r/reactnative/comments/hc43vg/how_can_you_modify_the_native_code_of_someone/)
My current situation is that I’m trying to modify an NPM package that contains Native code (both Java and Objective-C).
However, the changes that I make to the Native code are never reflected in the final application.
According to the answers that I received on Reddit, it would seem that the reason is that Expo does not support direct changes to Native code unless your app is ejected (please correct me if this is wrong).
However, ejecting isn’t really an option for me, because I don’t have a Mac, so I would be unable to test my changes within the iOS code.
I had the idea that maybe I could Fork the package, and re-install it each time I modified it, but that doesn’t seem to work either.
Does re-installing the package really work (and I’m just doing it wrong) or does it not work?
If re-installing the package doesn’t work, can someone please explain to me as to where in the world Expo gets the Native code that makes these packages work?
Since changing the code on the fly doesn’t seem to work, I assumed that Expo must read the Native code at the time of the package’s installation (i.e. through NPM, yarn, etc) and cache it somewhere, but then why doesn’t re-installing the package after modifying it seem to do anything?
If Expo doesn’t read the Native code when the app is built nor when the package is installed, then I have absolutely no idea where the Native modules/code is actually coming from.