Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get bundle id in flutter

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;         });       } 
like image 545
Vithani Chandresh Avatar asked Jun 29 '18 09:06

Vithani Chandresh


People also ask

How do I find my bundle ID code?

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.

How can I get iOS bundle ID in Flutter without XCode?

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!


2 Answers

To find the project name manually, you can look in AndroidManifest.xml or in Info.plist.

Android

In Android the package name is in the AndroidManifest:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"     ...     package="com.example.appname"> 

iOS

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; 

See also

  • How to change package name in flutter?
like image 166
Suragch Avatar answered Sep 28 '22 04:09

Suragch


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.

like image 38
Mohsen Emami Avatar answered Sep 28 '22 03:09

Mohsen Emami