2016-08-10 2 views
0

J'ai mis en place des notifications push pour Chrome & firefox. Et tester en utilisant la commande curl sur la ligne de commande.Web Push: le point de terminaison firefox renvoie InvalidRegistration ID

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

Je reçois le point final de l'utilisateur de

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

point final de chrome fonctionne très bien

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

ID d'enregistrement GCM du point final:

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

Mais point final de Firefox (ni ghtly) lance InvalidRegistration à partir de gcm. ENDPOINT:

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

ID d'enregistrement pour GCM

gAAAAABXqswopJKVeUQEsBZl12RXsKl01wNvt5T-yqLxgzReRPRdWp7K3xJK58Tmz9YWy3op550irfD3nx-DMnqNKu8BdzvbKgjlksN2_i8VJV-oWnkO8FJwgP-0-m4W9ZVNHYseLLDJ 

Répondre

2

Vous pouvez essayer la solution dans ce SO question, que de votre point final Firefox

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

Retirez la partie v1, et vérifier si Cela résout ce problème. Parce que selon cette question SO, cet ancien point de terminaison n'a pas de v1 et fonctionne maintenant. Vous pouvez également essayer la solution elle-même et appliquer la partie Note en utilisant TTL header.