This is a migrated thread and some comments may be shown as answers.

Send a notification to a segment, from code

2 Answers 85 Views
General Discussion
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Henrik
Top achievements
Rank 1
Henrik asked on 06 Sep 2013, 09:35 AM
Hi!

We are trying out Everlives Push Notifications. We are trying to send a notification to a specific segment, from code, how is it done?

// Method
_everlive.push.notifications.create()

2 Answers, 1 is accepted

Sort by
0
Henrik
Top achievements
Rank 1
answered on 06 Sep 2013, 10:11 AM
We are also wondering if it is possible to set an expire date for the notification, from code?
0
Steve
Telerik team
answered on 10 Sep 2013, 11:56 AM
Hi Henrik,

With Everlive you can send push notifications to either all of the devices in your application or to a segment. The segment represents devices that are filtered based on a set of conditions.

The syntax for Filter field is the same as the filter for content types, but you use the fields of the device registrations. This way you can specify a platform or a platform version, specific devices, or use the custom parameters (key-value pair collection where the key is the name of the parameter) of registrations. You can read more about the topic here. Here are some sample filters:

"Filter": "{\"PlatformType\": 1}" // filter by platform
"Filter": "{\"$or\":[{\"Id\":\"deviece id 1\"},{\"Id\":\"device id 2\"}]}" // targets specific devices
"Filter": "{\"Parameters.MyIntValue\":2}" // filter by custom parameter

If a push notification is set to use a segment and is scheduled for a given date the devices will be filtered at the moment of sending the notification to the provider.

Setting expiry date is done via the ExpirationDate property, which is of date type. For more information check this topic.

Regards,
Steve
Telerik

Looking for tips & tricks directly from the Icenium team? Check out our blog!
Share feedback and vote for features on our Feedback Portal.
Tags
General Discussion
Asked by
Henrik
Top achievements
Rank 1
Answers by
Henrik
Top achievements
Rank 1
Steve
Telerik team
Share this question
or