GithubHelp home page GithubHelp logo

python-library's Introduction

About

This here is a library for using the Urban Airship web service API for iPhone push notifications.

Requirements

Tested on Python 2.5 and 2.6 -- it'll probably work on earlier versions. If you're using Python 2.5 or earlier, you'll need to install simplejson.

Functionality

As of 0.5 the library handles these parts of the API:

  • device token registration
  • basic push
  • registering and pushing with tags
  • broadcast
  • feedback service
  • device token deactivation (deregistration)
  • device token listing
  • rich push
  • scheduled notifications

Usage

Simple iOS Push

>>> import urbanairship
>>> airship = urbanairship.Airship(application_key, master_secret)
>>> airship.push({'aps': {'alert': 'Hello'}}, aliases=['adam'],
...     device_tokens=['some_other_token'])

Broadcast to iOS, Android, and BlackBerry devices

>>> import urbanairship
>>> airship = urbanairship.Airship(application_key, master_secret)
>>> airship.broadcast({
...     'aps': {'alert': 'Hello iOS'},
...     'android': {'alert': 'Hello Android'},
...     'blackberry': {
...         'body': 'Hello BlackBerry',
...         'content-type': 'text/plain',
...     },
... })

Sending a Rich Push message to a single user

>>> import urbanairship
>>> airship = urbanairship.Airship(application_key, master_secret)
>>> richpush = airship.create_rich_push()
>>> richpush.add_recipents(users=["<user_id>"])
>>> richpush.set_message(
...     "Hello, Rich Push User",
...     "<html><h1>Hello!</h1><p>Goodbye.</p></html>")
>>> richpush.send()

Questions

The best place to ask questions is our support site: http://support.urbanairship.com/

History

  • 0.1 Initial release
  • 0.2 Added tags, broadcast, feedback
  • 0.3 Added deregister, device token list, other minor improvements
  • 0.4 Added batch push
  • 0.5 Added Android, Blackberry, Rich Push, and scheduled notifications

python-library's People

Contributors

mgood avatar robotadam avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.