Home > OS >  Get Package name in react-native
Get Package name in react-native

Time:09-01

I am new in react-native development. How we can get package name in react-native. Does anyone have any ideas?

CodePudding user response:

For android package name is inside YouApp/android/app/src/main/AndroidManifest.xml

    package="com.example">```

CodePudding user response:

Hey you can use the package device info https://www.npmjs.com/package/react-native-device-info

and use it like this , its a pretty well maintained library

  DeviceInfo.getInstallerPackageName().then((installerPackageName) => {
      // Play Store: "com.android.vending"
      // Amazon: "com.amazon.venezia"
      // Samsung App Store: "com.sec.android.app.samsungapps"
      // iOS: "AppStore", "TestFlight", "Other"
    });

CodePudding user response:

You can do it with simple lib Version Check

Just run VersionCheck.getPackageName()

  • Related