Find an iOS bundle identifier in the flutter application
Asked Answered
R

3

12

I am working on a flutter app and cannot find the bundle identifier. According to the documentation here (https://firebase.google.com/docs/flutter/setup), it should be in the General tab but I can't find it. I've also read in places that it could be here: ios/Runner.xcodeproj but my project doesn't contain that. Thanks!

Rudin answered 8/2, 2020 at 22:4 Comment(0)
T
23

Easiest way to find it is doing the following:

  • Open your Flutter Project on Android Studio or VS Code
  • Search PRODUCT_BUNDLE_IDENTIFIER =
  • Hit Enter, open the file and check your Bundle Identifier

Android Studio Search

There's other way to do it but you need MacOS with XCode installed:

  • With Finder got to your Flutter folder, then iOS and open Runner.xcworkspace (white icon)
  • Double click and open it on XCode.
  • Upper left corner (Project Navigation), click on Runner
  • Over Identity you'll have several fields, one of those is Bundle Identifier

XCode Project Navigation

Transmontane answered 8/2, 2020 at 22:16 Comment(1)
Thanks @Mariano Zorrilla!Rudin
O
4

For Bundle ID and Package Name changes,

For IOS:

  1. Look for file

project/ios/Runner.xcodeproj/Info.plist

<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>

<key>CFBundleName</key>
<string>notification</string>
  1. To change the value, look for file

project/ios/Runner.xcodeproj/project.pbxproj

PRODUCT_BUNDLE_IDENTIFIER = com.sara.fcm.notification;
  1. flutter clean

For Android (4 places):

  1. AndroidManifest.xml

android/app/src/main/AndroidManifest.xml
android/app/src/debug/AndroidManifest.xml
android/app/src/profile/AndroidManifest.xml

  1. android/app/build.gradle

    defaultConfig {
       applicationId "com.sara.fcm.notification"
     ....
    }
    
  2. (kotlin or java) android/app/src/main/kotlin/com/../MainActivity.kt

package com.sara.fcm.notification
import io.flutter.embedding.android.FlutterActivity
class MainActivity: FlutterActivity() {}
  1. Refactor the directory name(MainActivity) and flutter clean
Outwards answered 4/9, 2021 at 17:15 Comment(0)
A
0

Here is the simplest way:

It's the value inside the String tag in file Info.plist located in the folder ios/Runner .

enter image description here

Bundle ID will be here : <string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>

enter image description here

You can modify it

Albertype answered 7/2, 2021 at 1:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.