Is it possible to send notification to user when he's not on the app screen

Hi Team,
I am trying to build an app whch may need to work on background and notify users in case there’s anything needs attention of user. Is this kind of use case supported when user is not active on view of my app .

Hey @vishwajeets
All automations using due dates are triggered when a given date is reached without forcing a user to perform any actions.

Sure this is possible, but remember you API requires a boardid to sent the notification (although it is visible in any part of the frontend). I use this function.

static async sendNotification(token, userId, targetId, notificationText) {
try {
const mondayClient = initMondayClient();
mondayClient.setToken(token);
const query = mutation create_notification($userId: Int!, $targetId: Int!, $notificationText: String!){ create_notification(user_id: $userId, target_id: $targetId, text: $notificationText, target_type: Project) { text } } ;

  const variables = { userId, targetId, notificationText };
  const response = await mondayClient.api(query, { variables });
  return response;
} catch (err) {
  console.log(err);
}

}

And this ia an example from a call to this function:

notificationText =
“The feature " +
solutionName +
" is granted a trial period of 30 days. Please visit excellent-team.nl/solutions if you want to purchase this feature.”;
mondayService.sendNotification(token, userId, boardId, notificationText);

1 Like

Thank you.
I am assuming this has to be done from server side as client side code won’t exist when user is not on the given apps context . Let me know if that’s correct assumption .

Yes, I confirm it.
I suggest you to take a look at existing automations for due dates like the following ones.

All “due date” automations don’t require an actual action by the user.

Sounds good thank you. I wil check the automations you have mentioned.

1 Like