[Vuejs]-Send Expo Push Notification to an Array of Token

0👍

I couldn’t find a solution using the frontend, so I made an endpoint to send push through the backend. So the backend takes care of all the bulk shipping.

const dataObj = {
  sound: "default",
  title: this.dataObj.push_title,
  body: this.dataObj.push_message,
};
await this.$http
  .post(`/push/send-notification`, dataObj)
  .then((response) => {
    if (!response.data.success) {
      this.goError(response.data.message);
    } else {
      this.goSuccess(response.data.message);
      this.dataObj.push_title = "";
      this.dataObj.push_message = "";
    }
  })
  .catch(function (error) {
    console.log(error);
  });

Leave a comment