Frage

Trying to test a push notification using nomad/houston, but it simply says unsuccessful. How can I debug and figure out why it isn't working?

$ TOKEN="< .. token ..>"
$ apn push $TOKEN -c apn.pem -m "testing testing" -e development -p
Password: *****
8 push notifications sent successfully
8 push notifications unsuccessful ()

This is the second time around, first time got all sorts of key errors.

Edit:

The issue was not quoting the bash variable. Stupid! The hint was 8 notifications, with only one token. The fix:

$ apn push "$TOKEN" -c apn.pem -m "message"
War es hilfreich?

Lösung

Looks like just junky code to me:

apn source:

case sent.length
when 1
  say_ok "#{sent.length} push notification sent successfully"
else
  say_ok "#{sent.length} push notifications sent successfully"
end

case unsent.length
when 1
  say_ok "#{sent.length} push notification unsuccessful (#{unsent.join(", ")})"
else
  say_ok "#{sent.length} push notifications unsuccessful (#{unsent.join(", ")})"
end

When unsent.length is zero, it says an error message using the wrong variable. Dumb.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top