parse-community / parse-server-push-adapter

A push notification adapter for Parse Server
https://parseplatform.org
MIT License
88 stars 100 forks source link

Parse Push to iOS hanging in parse-server 2.5.3 #88

Closed dplewis closed 7 years ago

dplewis commented 7 years ago

In reference to https://github.com/parse-community/parse-server/issues/4015

Parse.Cloud.define('sendPushToUsers', (req, resp) => {
  const pushQuery = new Parse.Query(Parse.Installation);
  const user = new Parse.Object('_User');
  user.id = 'YXLPLWXJ71';
  pushQuery.equalTo('user', user);
  Parse.Push.send({
    where: pushQuery,
    data: {
      alert: 'Hello Squad',
      title: "GreatApp"
    }
  }, { useMasterKey: true })
    .then(() => resp.success('Push was sent successfully.'))
    .catch((error) => { resp.error(`Push failed: ${error.message}`); });
});
info: Ran cloud function sendPushToUsers for user undefined with:
  Input: {"name":"value"}
  Result: "Push was sent successfully." functionName=sendPushToUsers, name=value, user=undefined
(node:42607) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): 
TypeError: notification.setAlertTitle is not a function