Android app won't open from Firebase cloud notification

Viewed 72

I have a very basic Android app written in native Kotlin and a server running Umbraco (ASP.NET). I'm using the Firebase .NET API to send a notification from this server to the Android app.

What I want: The phone receives the notification, when the notification is clicked the app is launched and navigates to the URL sent as data with the notification.

What actually happens: The phone receives the notification. When clicked, the notification is dismissed.

My AndroidConfig is built as follows, though I've tried several values for ClickAction

fbMessage.Android = new AndroidConfig
{
    Notification = new AndroidNotification
    {
        ClickAction = "android.intent.action.MAIN"
    },
    Data = new Dictionary<string, string>
    {
        {"url", clickUrl + "?frompush=2"}
    }
};

The activity is defined as:

<activity android:name=".MainActivity">
    <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
        <category android:name="android.intent.category.DEFAULT" />
    </intent-filter>
</activity>
1 Answers

The issue was in the message sent from the server. I removed the whole AndroidConfig part, instead setting only the default settings in the MulticastMessage object. Then it opened the app and passed the .Data dictionary in the intent extras.

Related