i'm trying to send a push notification inside the phonegap application whenever the user has a like / comment activity, but i'm not sure the correct way/syntax of doing so, I tried going through the API doc but there're no examples, and I tried below in my javascript file:

var myobj = {
                                            "request": {
                                                "application": "xxxxx-xxxxx",
                                                "auth": "xxxxxxxxxxxxxxxxxx",
                                                "notifications": {
                                                    "content": "Hello world",
                                                }
                                            }
                                      };
                          var pushNotification = window.plugins.pushNotification;
                          pushNotification.createMessage(myobj);

Could anyone kindly pinpoint / advise the correct way to do so? thank you.

asked 20 Aug '14, 15:33
Venice%20Leung's gravatar image

Venice Leung
111

Hello,

Please note that there is no "createMessage" method in our current SDK. You should send a request to our servers manually.

As for the request itself, it actually contains a couple of misprints:

  1. "Notifications" is an array of JSON objects, so there should be two pairs of brackets there:

    "notifications": [{ 
    ...
    }]
    
  2. "Send_date" is a required section of the request.

permanent link
answered 25 Aug '14, 10:11
Dmitry%20%20Dyudeev's gravatar image

Dmitry Dyudeev
3.7k7

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×165
×91
×52

question asked: 20 Aug '14, 15:33

question was seen: 807 times

last updated: 25 Aug '14, 10:11