I used the below method to get the app name and packageName but I need Bundle id for iPhone users. I want to share an app link. I did it in android but on iPhone, I need bundle id.
Future<Null> _initPackageInfo() async { final PackageInfo info = await PackageInfo.fromPlatform(); setState(() { _packageInfo = info; packageName = info.packageName; appName = info.appName; buildNumber = info.buildNumber; }); }
Open you project with XCode, select the top project item in the project navigator at the left. Then select TARGETS -> General. Bundle Identifier is found under Identity.
In the root folder of your project you probably have a file called Info. plist if you open this file in any text/code editor you can search by CFBundleIdentifier. The next line will show your Bundle ID. That's great!
To find the project name manually, you can look in AndroidManifest.xml or in Info.plist.
In Android the package name is in the AndroidManifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android" ... package="com.example.appname">
In iOS the package name is the bundle identifier in Info.plist:
<key>CFBundleIdentifier</key> <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
which is found in Runner.xcodeproj/project.pbxproj:
PRODUCT_BUNDLE_IDENTIFIER = com.example.appname;
In iOS portion of a Flutter project Product Bundle Identifier is in project.pbxproj
file in path:
[your-flutter-project-dir]\ios\Runner.xcodeproj\project.pbxproj
and that is specified as following:
PRODUCT_BUNDLE_IDENTIFIER = com.app.flutter.example;
Note in that this value is same as Android Package Name
in Flutter projects.
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