Skip to main content

Python package for using the Urban Airship API

Project description

About

urbanairship is a Python library for using the Urban Airship web service API for push notifications and rich app pages.

Requirements

As of version 0.6, Python 2.6 or 2.7 is required. Python 3.3 support will follow.

Functionality

Version 0.6 is a major upgrade, focusing on support for the new version 3 push API. There has also been a major reorganization of the codebase.

  • 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

See the full documentation, as well as the Urban Airship API Documentation.

Simple iOS Push

>>> import urbanairship as ua
>>> airship = ua.Airship('application_key','master_secret')
>>> push = airship.create_push()
>>> push.audience = ua.or_(ua.alias('adam'), ua.device_token('some_token'))
>>> push.notification = ua.notification(alert='Hello')
>>> push.device_types = ua.all_
>>> push.send()

Broadcast to iOS, Android, and BlackBerry devices

>>> push = airship.create_push()
>>> push.audience = ua.all_
>>> push.notification = ua.notification(
...     ios=ua.ios(alert='Hello iOS'),
...     android=ua.android(alert='Hello Android'),
...     blackberry=ua.blackberry(alert='Hello BlackBerry'))
>>> push.device_types = ua.device_types('ios', 'android', 'blackberry')
>>> push.send()

Sending a rich app page to a single iOS device

>>> import urbanairship
>>> airship = urbanairship.Airship('application_key','master_secret')
>>> push = airship.create_push()
>>> push.audience = ua.device_token('some_token')
>>> push.notification = ua.notification(alert='Hello')
>>> push.device_types = ua.device_types('ios')
>>> push.message = ua.message(
...     "Hello, Rich Push User",
...     "<html><h1>Hello!</h1><p>Goodbye.</p></html>")
>>> push.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

  • 0.6 Major refactoring, support for push api v3

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

urbanairship-0.6.2.tar.gz (12.7 kB view details)

Uploaded Source

File details

Details for the file urbanairship-0.6.2.tar.gz.

File metadata

File hashes

Hashes for urbanairship-0.6.2.tar.gz
Algorithm Hash digest
SHA256 4747cebec0896e5af2bae3e13b47519b0395a9b432fa9b8a755be1940f2eece6
MD5 713000203b506dae00e71baffdb26f8e
BLAKE2b-256 42a080ab875d20ab40bfeb4ae97939ff48df0f8eb3f3701ce90cdfc2b00b498a

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page