Ruby 推送通知失败--为什么?

Ruby 推送通知失败--为什么?,ruby,apple-push-notifications,Ruby,Apple Push Notifications,尝试使用测试推送通知,但它只是说不成功。如何调试并找出它不工作的原因 $ TOKEN="< .. token ..>" $ apn push $TOKEN -c apn.pem -m "testing testing" -e development -p Password: ***** 8 push notifications sent successfully 8 push notifications unsuccessful () 在我看来: apn来源: case sent.

尝试使用测试推送通知,但它只是说不成功。如何调试并找出它不工作的原因

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

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
为零时,它会使用错误的变量显示错误消息。哑巴

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