androidfluttervisual-studio-codefirebase-in-app-messaging

How can I get the FirebaseInstanceId using VSCode?


In flutter I'm using Firebase In-app messaging. It says that to test my campaigns on my device I can provide a Firebase Instance ID:

enter image description here

Documentation says

Find your testing app's Instance ID by checking the Logcat in Android Studio for the following Info level log: I/FIAM.Headless: Starting InAppMessaging runtime with Instance ID YOUR_APP_ID

But I'm using Visual Code Studio to run my Flutter code. In "Debug Console" tab I do have some messages related to FIAM.Headless but nothing about "Starting InAppMessaging runtime with Instance ID YOUR_APP_ID"

How can I get the Firebase Instance IDs in Flutter?


Solution

  • The Flutter extension for VS Code doesn't include anything for displaying raw logcat output like Android Studio but you can run adb logcat in the built-in Terminal to get the same output that you would in Android Studio.

    Though as mentioned above, you could print the token yourself without needing to parse through the full output, something like:

    firebaseMessaging.getToken().then(print);