fcm-django-web-demo icon indicating copy to clipboard operation
fcm-django-web-demo copied to clipboard

Not getting notifications - Config looks different on the front end site?

Open allinws opened this issue 3 years ago • 0 comments

Not getting any notifications, guessing it's because I'ven not set up the config correctly to my firebase account. The config looks different from the one in the project, so not sure on how to implement it. This is what mine look like?

<script type="module">
  // Import the functions you need from the SDKs you need
  import { initializeApp } from "https://www.gstatic.com/firebasejs/9.8.0/firebase-app.js";
  // TODO: Add SDKs for Firebase products that you want to use
  // https://firebase.google.com/docs/web/setup#available-libraries

  // Your web app's Firebase configuration
  const firebaseConfig = {
    apiKey: "xxxx",
    authDomain: "xxx-test.firebaseapp.com",
    projectId: "xxx-test",
    storageBucket: "xxxx-test.appspot.com",
    messagingSenderId: "xxx",
    appId: "xxxx
  };

  // Initialize Firebase
  const app = initializeApp(firebaseConfig);
</script>

EDIT:

So OK I filled out the credentials as you prescribe:

<script src="https://www.gstatic.com/firebasejs/4.1.2/firebase.js"></script>
<script>
const firebaseConfig = {
    apiKey: "xxx",
    authDomain: "xx-test.firebaseapp.com",
    projectId: "xx-test",
    storageBucket: "xx-test.appspot.com",
    messagingSenderId: "xx",
    appId: "xxx"
  };

  firebase.initializeApp(firebaseConfig);
</script>

and then i replaced credentials.json with my own credentials from Firebase. But now when I'm trying to post a test message I get these messages in django admin:

A message failed to send. 1 device was marked as inactive.

Requested entity was not found. (Registration ID/Tokens: xxxx

allinws avatar May 09 '22 12:05 allinws