Exemple #1
0
def notifyUsers():
    pusher = Pusher(app_id=u'422470',
                    key=u'd05669f4df7a1f96f929',
                    secret=u'67125152b0087bcd5a4c',
                    cluster=u'us2')

    pusher.notify(
        ['cook_available'], {
            'gcm': {
                'notification': {
                    'title': 'Cookies are now available!',
                    'icon': 'androidlogo'
                }
            }
        })
    return "Successfully pushed notification"
Exemple #2
0
# Install the server library with:
#   pip install 'pusher>=1.4' --upgrade

from pusher import Pusher

pusher = Pusher(app_id=u'424832',
                key=u'575e480f6f4c0941387e',
                secret=u'd42c6b7d26dded3c235c',
                cluster=u'us2')

pusher.notify(
    ['kittens'],
    {'gcm': {
        'notification': {
            'title': 'hello world',
            'icon': 'androidlogo'
        }
    }})