Sending push notification using template to selected devices via API

me too - I want the exact same functionality :slight_smile:

Great, we are two now claiming for that feature :grinning:

1 Like

Try this approach:

  1. create Push Template where Who is a segment.
  2. segment should be like objectId = {recipient_id}
  3. Use such an approach to send message with template:
HashMap<String, String> templateValues = new HashMap<>();
templateValues.put("recipient_id", "<some_value>");
Backendless.Messaging.pushWithTemplate("templateName", templateValues);

You can use more than one variable in the request.

1 Like

Thanks @oleg-vyalyh,

I will try this and I’ll get back to you with the result.

Best regards

Hi @oleg-vyalyh

!!! It works !!!

I tried putting user.objectId = {userId} and also user.objectId in ({userId}), then I passed a single objectId, and in the last case a comma separated list of objectId’s, into templateValues.

@Graham_Reddie Did you tried this approach?

Best regards

hi @Nono_Carballo I haven’t yet but I really needed the ability to create templates via the API rather than just change the target audience. Great that the approach works though.

Hi @Graham_Reddie,

Create templates via API is also a valid approach, It is not my urgency right now, but I’m very interested in this idea too. I don’t know if we could continue with this subject in this thread or move to a new one.

Best regards

1 Like

Hello @Nono_Carballo

In order to make it easier to help you, I would advise you to create a new topic with a full description of the new question.

can i use this approach with codeless?

Hello @mohammad_altoiher

Unfortunately, there is no such input for specifying the template values, but I’ve created an internal ticket BKNDLSS-23433 to fix it. Once it’s fixed and released we will notify you here.

Regards, Vlad

1 Like

Hello @mohammad_altoiher

We’ve added the ability to specify template values via Codeless:
https://monosnap.com/direct/qUEu1U4V6LlUSdMieIgAuP0zwKd4YA

Regards,
Inna

2 Likes