Send a notification to a segment, from code

3 posts, 0 answers
  1. Henrik
    Henrik avatar
    23 posts
    Member since:
    Jan 2013

    Posted 06 Sep 2013 Link to this post

    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. Henrik
    Henrik avatar
    23 posts
    Member since:
    Jan 2013

    Posted 06 Sep 2013 Link to this post

    We are also wondering if it is possible to set an expire date for the notification, from code?
  3. Steve
    Admin
    Steve avatar
    10941 posts

    Posted 10 Sep 2013 Link to this post

    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.
Back to Top