1

I have tried so many things but it still shows me these Problems:

Missing Default Notification Channel metadata in AndroidManifest

The notification are coming but sometimes they take minutes to arrive.

Also I tried many things to put in the backroundhandler but when I do it like this: Flutter- FCM A background message could not be handled in Dart as no onBackgroundMessage handler has been registered , I just get : Unhandled Exception: Null check operator used on a null value

I hope that someone can help me with this.

Here is my AndroidManifest.xml (Also there are 9 errors in my AndroidManifest, is this normal (eg. Attribute android:icon is not allowed here)?):

    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.stammi">
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
   <application
        android:label="orga"
        android:icon="@mipmap/ic_launcher">


        <activity
            android:name=".MainActivity"
            android:launchMode="singleTop"
            android:theme="@style/LaunchTheme"
            android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
            android:hardwareAccelerated="true"
            android:windowSoftInputMode="adjustResize">
            <meta-data
              android:name="io.flutter.embedding.android.NormalTheme"
              android:resource="@style/NormalTheme"
              />
            <meta-data
              android:name="io.flutter.embedding.android.SplashScreenDrawable"
              android:resource="@drawable/launch_background"
              />
            <intent-filter>
                <action android:name="android.intent.action.MAIN"/>
                <category android:name="android.intent.category.LAUNCHER"/>
            </intent-filter>
         
            <intent-filter>
                <action android:name="FLUTTER_NOTIFICATION_CLICK" />
                <category android:name="android.intent.category.DEFAULT" />
            </intent-filter>


        </activity>
           <service
               android:name=".MyInstanceIDListenerService">
               <intent-filter>
                   <action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
               </intent-filter>
           </service>

           <service
               android:name=".MyFirebaseInstanceIDService">
               <intent-filter>
                   <action android:name="com.google.firebase.INSTANCE_ID_EVENT"/>
               </intent-filter>
           </service>
        <!-- Don't delete the meta-data below.
             This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
        <meta-data
            android:name="flutterEmbedding"
            android:value="2" />
    </application>
</manifest>
knobi
  • 133
  • 1
  • 1
  • 9
  • Hi, what flutter plugins are you using for FCM? I would highly recommend FlutterFire for this. –  Oct 20 '21 at 13:21
  • Hi, thanks for your response. Do you mean the plugins in Android Studio? I can't find FluterFire and my Firebase Assistant is loading forever, so I don't know why this is not working :/ – knobi Oct 20 '21 at 13:48
  • No sir, flutter plugins in your pubspec.yaml? Or if it not a flutter application, then it is an embedded application please let us know. –  Oct 20 '21 at 13:49
  • Okay to me it seems you are not using Flutter? Or rather embedding Flutter into a Native Android Application? If so your question would be best served, changed to the Android and not Flutter Tags. –  Oct 21 '21 at 06:11
  • No I'm using flutter. So if I get the flutterfire plugin on pub.dev it will help? – knobi Oct 21 '21 at 07:08
  • Is this the one you are talking about?https://pub.dev/packages/fireflutter – knobi Oct 21 '21 at 07:11
  • This is the official one used created by the FCM team for Flutter: https://firebase.flutter.dev/ The documentation is perfect and I use it on my apps in full production :) –  Oct 21 '21 at 09:40
  • Thanks, I've added the missing ones but still says the same :/ . I also don't understand why my firebase assistant isn't working in android studio :/ Think my Android Studio is not working properly :S Flutter doctor is saying that ther are no problems – knobi Oct 21 '21 at 11:50

0 Answers0