How to send notification via API with title,summary and text

I want to send simple notifications with below field :
1. Title ,2. Text , similarly as i can send notification with title,summary and text field from urban airship console with having free account.

I need API for the same,so that I Can push the notification using API.

Didn't find what you were looking for?

New post

Comments

4 comments

  • Hi Om,

    You can add titles, summaries and alert text to both iOS and Android payloads via the API. I'll link to the documentation that describes how to do so below:

    Please let me know if you have any other questions or concerns.

    Best regards,
    Jenn Miller

    Comment actions Permalink
    0
  • Hi Jennifer,

    I tired to hit API which is mentioned in Doc (link given by you), but I was not able to send Push notification,

    Can you please share exact JSON format to send Push Notification with Title, as I'm already able to send Notification of alert using below JSON with API 'https://go.urbanairship.com/api/push'

    {
       "audience": {
          "ios_channel": "fdf5e87b-67b9-4f2f-8361-e21aab07f808"
        }, 
       "notification": {
           "alert": "Hello!",
       },
       "device_types": "all"
    }

    but not clear how to send 'title' for Notification along with 'alert'

    Thanks,

    Om Kesarwani

     

    Comment actions Permalink
    0
  • I am getting below error, when i am using the API.

    I just want to send simple notifications with below field :
    1. Title ,2. Text , similarly as i can send notification with title, summary and text field from urban-airship console with having free account.

    Please do the needful.

     

     

     

    Comment actions Permalink
    0
  • Hi Om,

    If you wanted to send a push notification with a title to both iOS and Android, the body of the payload would look something like this:

    {
      "audience": "all",
      "notification": {
        "ios": {
          "alert": "Hello iOS!",
          "title": "Insert title here"
        },
        "android": {
          "alert": "Hello Android!",
          "title": "Insert title here!"
        }
      },
      "device_types": ["ios", "android"]
    }

    You could also modify this to send to just iOS or Android. I can send you a cURL request with the above JSON in the payload body if you wanted to test it quickly on your end. 

    Best regards,

    Jenn Miller

    Comment actions Permalink
    1

Please sign in to leave a comment.