Saturday, 31 October 2020

FCM notification "click_action" not working

I'm using a Cloud Function and sending push notifications with it. Sending notification works as expected but click_action attribute not working. When I click the notification nothing happens. Here is my code:

My notification payload:

const payload = {
  notification: {
      title: 'Soru Çözüm',
      body: 'Attığınz soruya bir yorum geldi: ' + data.content,
      icon: 'ic_stat_logo',
      click_action: '.activities.SoruDetayActivity'
  },
  data: {
      title: 'Soru Çözüm',
      content: 'Sorunuz çözüldü.',
      post: data.parent
  }
};

Intent Filter:

<activity
    android:name=".activities.SoruDetayActivity"
    android:label="Soru"
    android:windowSoftInputMode="adjustResize">
    <intent-filter>
        <action android:name="android.intent.action.VIEW" />
        <action android:name=".activities.SoruDetayActivity"/>

        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />

        <data
            android:host="www.website.com"
            android:scheme="https" />
    </intent-filter>
</activity>


from FCM notification "click_action" not working

No comments:

Post a Comment