We've hit a problem that could be solved if we know the bundle identifier at run time in our RN app. We've seen a few libraries but would rather not include a whole library to do this one thing. Is there a simple way to get this information in the code?
Thanx
To find your react native iOS project Bundle ID first open your iOS react native project in MAC. 2. Select the iOS folder . 3. Open the file named as Your_Project_Name.xcodeproj in XCODE.
If you want to change bundle identifier in react-native project. You must have to change app identifier separately for both side android and ios. Goto your AndroidManifest.xml. Just place your cursor in the package name, don't select it just place it.
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) [application_build_scheem] .plist (this is a dict/xml file that contains keys that are used by default if no changes added to project (react-native-cli init type of project)
You can get the bundle identifier from Application. persistentDataPath at least on Android. My colleague suggested this idea. Thank you for the plugin. I'll try that out and I guess try to make one for the Android side as well. Still seems very ridiculous to need to create a plugin to access a key component of an application run-time.
on mac you can see it inside general Tab
you can also use
import DeviceInfo from "react-native-device-info";
console.log("@ device ",DeviceInfo.getBundleId())
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