Starting a new react-native project, the xcode-project gots the bundle-identifier "org.reactjs.native.example.XYZApp". XYZ is the placeholder here for my real project name.
Is there any way to change this bundle identifier on react-native side? Sure, I can change it in XCode. But this is not safe because it can be overriden when react-native will recreate the xcode-project, which could happen at any time, as well es when rebuilding the project.
Go to Project Options --> Build --> Android Application --> Package name.
To create a unique bundle identifier, you append the name of the application to the reversed domain, for example, com. cocoacasts. scribbles . Remember that you choose the bundle identifier.
Based on the react-native version you are using there are bunch of files that have to be changed on both platforms (android and ios)
It's worth mentioning that there is an an npm module (https://www.npmjs.com/package/react-native-ci-tools) that does all of the above; use it and make life easy.
Update Folder Paths:
We also need to change the folder paths to match new name -- change com.oldName
to com.newname.mobile
, then change folder paths from app/src/java/com/oldName/
to app/src/java/com/newname/mobile/
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With