WindowsPhoneへのPush通知は長いことTwiProwl/IMAProwl + toastyという組み合わせで使っていたのだがPushalotという良さそうなサービス、アプリケーションを見つけたので早速試してみた。
Pushalot
toastyと比べるとPushalotは以下の点が優れている。
- WindowsPhoneだけでなく、Windows 8向けにもクライアントアプリが用意されている。
- Push通知させるデバイスの管理がWeb上で行える。
- SSLに対応(toastyは対応してない)
- WindowsPhone8のLockscreenに未読の通知件数を表示させられる。
 
  
- 既読ステータスをデバイス間で同期できる。
 例:Lumia920と820に同じ通知をPush。920で通知を確認。820側も自動的に既読状態になる。
TwiProwlをPushalotに対応させる
PushalotのAPIページにRubyのサンプルコードが載ってるのでそれを使うのが楽
私はTwiProwlの360行目あたりに以下のコードを挿入した。
  def pushalot( icon, params={}, user = nil )
    begin
      require "net/https"
      url = URI.parse("https://pushalot.com/api/sendmessage")
      req = Net::HTTP::Post.new(url.path)
      req.set_form_data({
      :AuthorizationToken => "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
      :Title => params[:event],
      :Body => params[:description],
      :Image  => "https://ar3r3.com/icon_twiprowl.png",
      :Source => params[:application],
      
      })
      res = Net::HTTP.new(url.host, url.port)
      res.use_ssl = true
      res.verify_mode = OpenSSL::SSL::VERIFY_PEER
      res.start {|http| http.request(req) }
    rescue
      error "Error while Prowling: #{$!}"
    end
  end
こうした方がいいよ!みたいなツッコミ頂けると喜びます。