cordova fcm plugin on Android data.wasTapped not working
<p>I am trying to use cordova fcm plugin on Android to implement the data sent by Firebase Cloud Messaging. I successfully received the notifications, but when I tap them they are not giving the alert I want.</p>

<p>Here is the code used in index.js:</p>

<pre><code>    onDeviceReady: function() {
        app.receivedEvent('deviceready');
        FCMPlugin.onNotification(
            function(data){
                if(data.wasTapped){
                    //Notification was received on device tray and tapped by the user.
                    alert( JSON.stringify(data) );
                }else{
                    //Notification was received in foreground. Maybe the user needs to be notified.
                    alert( JSON.stringify(data) );
                }
            },
            function(msg){
                alert('onNotification callback successfully registered: ' + msg);
            },
            function(err){
                alert('Error registering onNotification callback: ' + err);
            }
        );
    },
</code></pre>

<p>And here is the php code I used to send the notification:</p>

<pre><code>    function pushAndroidNotification ($productUrl, $message, $deviceToken) {
        $url = 'https://fcm.googleapis.com/fcm/send';

        $fields = array(
            'registration_ids' =&gt; array($deviceToken),
            'notification' =&gt; array(
                "title" =&gt; "rBUX", 
                "body" =&gt; $message,
                "icon" =&gt; "name_of_icon" ),
            'data' =&gt; array("url" =&gt; $productUrl)
        );
        $jfields = json_encode($fields);
        echo "\r\n&lt;br&gt;Post json:".$jfields;

        $headers = array(
            'Authorization: key = AIzaSyBPRoJ7zgmevPYIzoDweVgNTbmsPBW5ofo',
            'Content-Type: application/json'
        );

        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_POST, true);
        curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $jfields);
        $result = curl_exec($ch);
        if ($result === FALSE) {
            echo "\r\n&lt;br&gt;Notify Failed:".curl_error($ch);
            die('Curl failed: '.curl_error($ch));
        }else{
           echo "\r\n&lt;br&gt;Notify passed:".$result;
        }
        $jresponse = json_decode($result, true);

        curl_close($ch);

        return $jresponse;
    }
</code></pre>

<p>But every time I launch the app, I can see the alert "onNotification callback successfully registered: OK", so the FCM plugin is not completely disabled.
I would like to launch the url when I tap on the notification, but for now it appears that I can't even use the data. If anyone knows how to solve this please tell me, and please let me know how to use stringified data to launch the url in cordova inAppBrowser, thank you.</p>