推送通知不成功 - 为什么?

时间:2014-04-16 16:12:31

标签: ruby apple-push-notifications

尝试使用nomad/houston测试推送通知,但它只是说不成功。我该如何调试并找出它无法正常工作的原因?

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

这是第二次,第一次遇到各种关键错误。

修改

问题不是引用bash变量。笨!提示是8个通知,只有一个令牌。修复:

$ apn push "$TOKEN" -c apn.pem -m "message"

1 个答案:

答案 0 :(得分:0)

对我来说只是junky code

apn来源:

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

unsent.length为零时,它会使用错误的变量显示错误消息。哑。