Anand Nagaraj
Anand Nagaraj

Reputation: 79

Web Push : firefox endpoint returns InvalidRegistration ID

I have implemented push notifications for Chrome & firefox. And testing using curl command on command line.

curl --header "Authorization: key=" --header "Content-Type: application/json" https://android.googleapis.com/gcm/send -d "{\"registration_ids\":[\"\"]}"

I'm getting user end point from

    reg.pushManager.subscribe({
        userVisibleOnly:true
    }).then(function(sub){
          console.log("ENDPOINT :",sub.endpoint);
        alert(sub.endpoint);
 });

end point from chrome works fine

https://android.googleapis.com/gcm/send/cQ4-FwONCH0:APA91bGjycCynoIPO-BVn0h…B9Ck_r5e3hYxcvmzamCWeWbVLDSeY18gtp-NZC3yFMVzFQauE3xQQn4vhVmfkiV3ma-cy4wIv0

Registration ID for GCM from end point :

cQ4-FwONCH0:APA91bGjycCynoIPO-BVn0h…B9Ck_r5e3hYxcvmzamCWeWbVLDSeY18gtp-NZC3yFMVzFQauE3xQQn4vhVmfkiV3ma-cy4wIv0

But endpoint from Firefox(nightly) throws InvalidRegistration from gcm . ENDPOINT :

 "https://updates.push.services.mozilla.com/wpush/v1/gAAAAABXqswopJKVeUQEsBZl12RXsKl01wNvt5T-yqLxgzReRPRdWp7K3xJK58Tmz9YWy3op550irfD3nx-DMnqNKu8BdzvbKgjlksN2_i8VJV-oWnkO8FJwgP-0-m4W9ZVNHYseLLDJ"

Registration ID for GCM

gAAAAABXqswopJKVeUQEsBZl12RXsKl01wNvt5T-yqLxgzReRPRdWp7K3xJK58Tmz9YWy3op550irfD3nx-DMnqNKu8BdzvbKgjlksN2_i8VJV-oWnkO8FJwgP-0-m4W9ZVNHYseLLDJ

Upvotes: 0

Views: 629

Answers (1)

KENdi
KENdi

Reputation: 7741

You can try the solution in this SO question, that from your Firefox endpoint

"https://updates.push.services.mozilla.com/wpush/v1/gAAAAABXqswopJKVeUQEsBZl12RXsKl01wNvt5T-yqLxgzReRPRdWp7K3xJK58Tmz9YWy3op550irfD3nx-DMnqNKu8BdzvbKgjlksN2_i8VJV-oWnkO8FJwgP-0-m4W9ZVNHYseLLDJ"

Remove the v1 part, and check if this solves this issue. Because according to this SO question, that old endpoint has no v1 and work now. You can also try the solution itself and apply the Note part by using TTL header.

Upvotes: 2

Related Questions