Web push notification error with curl send message
<p>I want to understand what is web-push and how can i use for my projects...
Have found this example <a href="https://mobiforge.com/design-development/web-push-notifications" rel="nofollow">https://mobiforge.com/design-development/web-push-notifications</a>
But always getting an error when try to send notification via Firebase Cloud Messaging (FCM is the new version of GCM)</p>

<pre><code>{"multicast_id":6440031216763605980,"success":0,"failure":1,"canonical_ids":0,"results":[{"error":"InvalidRegistration"}]}
</code></pre>

<p>What it means "InvalidRegistration"? What i'm doing wrong?</p>

<p>My php curl, but i am sure that there is no problem here</p>

<pre><code>$link = "https://gcm-http.googleapis.com/gcm/send";

$header = array();
// $header[] = "Content-length: 0";
$header[] = "Content-type: application/json";
$header[] = "Authorization: key=AIzaSy...";

$contentArray = array(
    "collapse_key" =&gt; "All",
    "registration_ids" =&gt; array(
        "gAAAAABX06BLKhA4n1yHNlsyzu02wxsDjZf89oxIljwM4ZdLpMZU7ty64TFEYahPQZaTmCeYlJo-WDWnfFHOKXzKURhNtRWmN0OgBgn9hJdmgatSGoiTkt69TeJpiD8F034WOr5HMEG2",
    ),
    "data" =&gt; array(
        "title" =&gt; "This is a Title",
        "message" =&gt; "This is a GCM Topic Message!"
    )
);
$jsonData = json_encode($contentArray);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $link);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POSTFIELDS, $jsonData);
$string = curl_exec($ch);
echo $string;

$data['curl'] = curl_errno($ch);

if(!curl_errno($ch) &amp;&amp; !strpos($string, "503"))
    $data = array_merge($data, explode("\n", $string));

curl_close($ch);

?&gt;&lt;pre&gt;&lt;? print_r($data); ?&gt;&lt;/pre&gt;&lt;?
</code></pre>

<p>some from Cosole.log</p>

<pre><code>ServiceWorker registration successful with scope: https://.../app/
PushSubscription { endpoint="https://updates.push.ser...rjYvTTapou7WcEDgu3V7IOY",  options=PushSubscriptionOptions,  getKey=getKey(),  ...}
PushSubscription { endpoint="https://updates.push.ser...rjYvTTapou7WcEDgu3V7IOY",  options=PushSubscriptionOptions,  getKey=getKey(),  ...}
gAAAAABX06OYvBIk4q2rRF3AsE6UwRYUpzpZ0jpuiWz6TRrSptb8_cBKjy8Ci-_u5UtAyiGfAYJ_ycYnJjoukSuez7BN6UnSX-GL_EWNAWzEpAVMhCT2wrjYvTTapou7WcEDgu3V7IOY
</code></pre>