Push Notification with Firebase + business rules

1

I have to receive push notification from firebase, but it is not for all phones that these notifications will be sent. My app checks changes in contracts, the user informs a CPF number and the app searches the database for information about the contracts under that CPF, and those contracts change frequently. So I wanted the user to receive notification in the app when any contract under the informed CPF was modified. I've already thought of sending push to all phones, and somehow Ionic show push only if the user's CPF is, but I found this solution very wrong.

    
asked by anonymous 03.04.2018 / 01:56

1 answer

0

Attempts the following, at the moment the user registers how to generate a fcm token for him:

this.fcm.getToken().then(token => {
  console.log(token);
  //Aqui você pode armazenar esse token em algum lugar (Local Storage) e depois na hora de criar o usuário você passa o mesmo.
});

Then when pushing, simply scroll through the CPF list you want, pick up and send the messages according to the token of each one.

References: link

link

    
03.04.2018 / 02:29