Android doesn´t receive push notifications from Airship with Firebase and Flutter

381 Views Asked by At

I configured an Airship test-project for Flutter as described on Airship website: https://docs.airship.com/platform/mobile/setup/sdk/flutter/ . In Firebase I use Cloud Messaging API and there I have several iOS and Android Apps in one project as I have multiple mandates in my app. The Server Key from Cloud Messaging API is set in Airship Android configuration.

As I start my app I can see Airship successfully started, push notifications on my physical device are enabled, I have a stable Internet connection and I can get my Channel ID. On iOS with similar settings push notifications work fine. But on Android I don´t receive any notifications. But this is a new behaviour, just a month ago push notifications worked fine on my Android device. I implemented Flutter Flavors to switch between mandators, could it influence the Airship/Firebase settings?

I don´t receive any errors in Error Console in Airship, neither in the console of the app.
I double check App Key and App Secret, the app and Airship are both in developer mode.

The only reaction in my console that I get when sending a push from Airship is:

D/FLTFireMsgReceiver(30006): broadcast received for message

1

There are 1 best solutions below

0
Anna R. On BEST ANSWER

In my case, I needed to add this code to my Android Manifest file, and then I was able to receive push notifications on Android as well:

<service android:name="com.urbanairship.push.fcm.AirshipFirebaseMessagingService">
   <intent-filter>
      <action android:name="com.google.firebase.MESSAGING_EVENT" />
   </intent-filter>
</service>