Skip to content

Push notification not working main.js #1740

@Twizzlerfw

Description

@Twizzlerfw

I am now on the new parse open source server and I am trying to send a push notification using the cloud main.js. I have sent a push using curl but am having a problem with javascript. Here is the code I have.

Parse.Cloud.define("PushNotification", function(request, response) {
  console.log('sending push');
var Installation = new Parse.Query(Parse.Installation);
  console.log(Installation);

Parse.Push.send({

    where: Installation,
  data: {
    alert: request.params.Message,
    badge: 0,
    sound: 'default'
  }
}, {
  useMasterKey: true,
  success: function() {
    // Push sent!
  console.log('Push sent');
        response.success('success');

  },
  error: function(error) {
    // There was a problem :(
          response.error("Error push did not send");
            console.log('sending push error: '+error);


  }
});

It says that it sent but It did not. If any one could help that would be great!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions