Hi, I’m having problems with the Android push notifications using Capacitor.
The notifications are received in both iOS and Android devices. Tapping the notifications on iOS device opens the app, but not in Android. In Android tapping a notification does not trigger anything.
I’ve searched for information and tried several solutions, but none of those worked.
Here it’s the message I send from the backend:
const message = {
token: “XXX”,
notification: {
title,
body: “XXX”,
},
data: {
click_action: “FLUTTER_NOTIFICATION_CLICK”,
title: “XXX”,
body: “XXX”,
notificationType: “XXX”,
messageType: “XXX”,
id: “XXX”,
},
apns: {
headers: {
“apns-priority”: “10”,
},
},
android: {
notification: {
defaultSound: true,
click_action: “FLUTTER_NOTIFICATION_CLICK”,
clickAction: “FLUTTER_NOTIFICATION_CLICK”,
},
},
My AndroidManifest.xml have the following:
<activity
android:exported=“true”
android:configChanges=“orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode”
android:name=“lbh.customer.portal.MainActivity”
android:label=“@string/title_activity_main”
android:theme=“@style/AppTheme.NoActionBarLaunch”
android:launchMode=“singleTask”>
<intent-filter>
<action android:name=“android.intent.action.MAIN” />
<category android:name=“android.intent.category.LAUNCHER” />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="@string/custom_url_scheme" />
</intent-filter>
<intent-filter>
<action android:name="FLUTTER_NOTIFICATION_CLICK" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
Any clue about what happens?