title: Open specific activity while clicking on notification triggered through Cloud Functions for Firebase
body: <p>i am having an android app which uses firebase as a backend.</p>
  
  <p>Using <strong>firebase cloud function</strong> as soon as the database is having change at a specific node, the notification triggers.</p>
  
  <p>But I am not able to figure out how to open specific activity according to the change at a specific node.</p>
  
  <p>I am having 5 activities and 5 node at database, the activity which should get open through notification should be the activity which corresponds to the change at the specific node.</p>
  
  <p>but right now it opens the default activity.</p>
  
  <p>I am not able to figure that how notification will contain the information of opening the specific activity in their payload as the notification are delivered through firebase cloud functions.</p>
  
  <p>the example file of index.js is pasted below, for changes in one child node only.</p>
  
  <pre><code>'use strict';
  
  const functions = require('firebase-functions');
  const admin = require('firebase-admin');
  admin.initializeApp(functions.config().firebase);
  
  
  exports.sendPowerNotification = functions.database.ref("/Matrimony").onWrite((event) =&gt; {
      const data = event.data;
      console.log('New Issue added');
      if (!data.changed()) {
          return;
      }
      const status = data.val();
      //const onOff =  status ? "on": "off";
      const author = event.params.author;
          const name = author.val();
  
      const payload = {
          notification: {
              title: 'SahuSmaj : New Matrimony Post',
              body: `New biodata entered,check it out`,
              sound: "default"
              click_action: "MATRIMONY"
          }
      };
  
      const options = {
          priority: "high",
          timeToLive: 60 * 60 * 24 //24 hours
      };
      console.log('Sending notifications');
      return admin.messaging().sendToTopic("matrimony", payload, options);
  
  });
  </code></pre>
  
  <p>executing the above code show this error :</p>
  
  <pre><code>    Error: Error occurred while parsing your function triggers.
  
  /private/var/folders/sf/2spqs2n1493d506bj06wj0zw0000gn/T/fbfn_1018VUGx2TTMO1y8/index.js:33
              click_action : "MATRIMONY"
              ^^^^^^^^^^^^
  SyntaxError: Unexpected identifier
      at Object.exports.runInThisContext (vm.js:76:16)
      at Module._compile (module.js:542:28)
      at Object.Module._extensions..js (module.js:579:10)
      at Module.load (module.js:487:32)
      at tryModuleLoad (module.js:446:12)
      at Function.Module._load (module.js:438:3)
      at Module.require (module.js:497:17)
      at require (internal/module.js:20:19)
      at Object.&lt;anonymous&gt; (/usr/local/lib/node_modules/firebase-tools/lib/triggerParser.js:16:9)
      at Module._compile (module.js:570:32)
  </code></pre>
  
  <p>I had made the changes in my <strong>AndroidManifest.xml</strong> for opening specific notification using <strong>Android Filter</strong>.</p>
  
  <pre><code>        &lt;intent-filter&gt;
              &lt;action android:name="MATRIMONY" /&gt;
              &lt;category android:name="android.intent.category.DEFAULT" /&gt;
          &lt;/intent-filter&gt;
  </code></pre>