ruby-mpns

A ruby gem to communicate with Microsoft Push Notification Service.

Installing

From the commande line:

gem install ruby-mpns

Or in your gemfile:

gem 'ruby-mpns'

Usage

To use it just use the singleton MicrosoftPushNotificationService like the following:

            uri = "http://my-uri.com/to/the-windows-phone-i-am-targetting"

            options = {
                    title: "Hello !",
                    content: "Hello Push Notification.",
                    params: {
                            any_data: 2,
                            another_key: "Hum..."
                    }
            }

            # response is an Net::HTTP object
            reponse = MicrosoftPushNotificationService.send_notification uri, :toast, options

See sample/sample_usage.rb for more samples.

Parameters

Toast notification

The following notification parameters can be defined in the options hash for :toast:

Raw notification

You can pass whatever hash you want and an XML will be generated, like the following:

            <root>
                            <key1>value1</key1>
                            <key2>value2</key2>
                            <subtree>
                                    <subkey>value</subkey>
                            </subtree>
            </root>

Tile notification

The following notification parameters can be defined in the options hash for :tile:

Reference

For general information about Push Notification on Windows Phone check the MSDN.

How to contribute ?

Missing features

Contributors

License

Copyright © 2012 Nicolas VERINAUD. Released under the MIT license.