vendredi 16 février 2018

FCM for PWA: Firebase data message also show notification when app in background in chrome

FCM for PWA

Firebase setBackgroundMessageHandler :-

 messaging.setBackgroundMessageHandler(function(payload) {
  return null;
});

payload:

{"data":{"body":"this is body","title":"notification title"}, "to":"sdsd7987:df789d....."}

setBackgroundMessageHandler function called but default notification shows in chrome but it working in firefox.

serviceWorkerRegistration.pushManager.subscribe({userVisibleOnly:false}) 

gives an error in chrome.




Aucun commentaire:

Enregistrer un commentaire