Support Topics Documentation Slack YouTube Blog

Notification from a push template to individual device(s)

Hi

The push notification templates are awesome.

However in our methodology we provide a user table where admin can select which users they want to send push notifications to, based on different types of criteria. We can still do this, but what would be really powerful is somehow combine this with the new templates. i.e set up a push template on the console (without the who bit just the content) and then in the api send this push template just to selected devices

rather like a cross over between
Backendless.Messaging.pushWithTemplate( templateName )

and a push notification to individual devices

deliveryOptions = new Backendless.DeliveryOptions({
pushSinglecast: [“dummyDeviceId_001”, “dummyDeviceId_002”] // devices IDs
});

something like
Backendless.Message.pushWithTemplate(“templateName”, [“deviceID01”, “deviceID02”])

That would give massive flexibility. It might be one for the future, but is there any work around now which could achieve this?

Mike

1 Like

I can not say definite time, but we have this feature in our nearest plans.

Thanks, that’s great news.

Similar, but not quite the same. Can I put aggregate functions into the segment query of the push template.

Like in the video Mark did on Push Notification Templates where he puts
user.age > 20 and user.address.city = ‘New York’

Lets say I have a related table called loyaltyPoints I would like to do something like this.

user.loyaltyPoints.Sum(points) > 1000. That might not be exact syntax but can we do something like that now or might that be in the pipeline too?

You may use any where clause that can be made in the query for Data Service. So, you may even test it there for DeviceRegistration table.

Thanks Oleg, but I can’t get it working

Could you give me an example syntax of using an aggregate function in the segment query? I don’t seem to be able to get it right and it has raised some internal tickets when I tried.

example,
I have standard user table and also a loyalty points table which stores users loyalty points

user.loyaltyPoints.loyaltyPointsValue > 100 // returns successfully all loyalty points of more than 100 in value

how could I return the sum/count/max/min of the loyalty points for a user. Just a rough idea of syntax to get me on the right track?

Hi Mike,

Could you please provide your AppId

btw, here is a doc for aggregate functions
https://backendless.com/docs/js/data_aggregate_functions_overview.html

Regards, Vlad

Hi Vladimir

Apologies for slow response.

Yes you can use this 49F668C0-314F-EB6F-FF03-8813A8AC1900

Mike

Hello mike,

Have you tried the aggregate functions to count the sum/count/max/min of the loyalty points?

Regards,
Olha

Morning Olha

I have read that link but that seems to use .setProperties of a datquerybuilider but I am trying to put something straight into the where clause. I am using the console not through code. I can’t find a syntax example anywhere of how I may go about this?

What about http request described here?

OK thanks I will take a look at that later and report back.