Skip to content
A Python library for using the Airship APIs for push notifications, reporting and other message types
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Update PULL_REQUEST_TEMPLATE.md Mar 22, 2019
docs requested changes Apr 24, 2019
tests tests for inline templates Mar 22, 2019
urbanairship use 2 conditionals for alert check Mar 25, 2019
.gitignore add mypython folder to be ignored Mar 18, 2019
.gitmodules Use UA theme Jun 17, 2013
.travis.yml rm py34, add py37 Mar 21, 2019
AUTHORS update version info (#80) Apr 7, 2017
CHANGELOG formatting Mar 21, 2019
LICENSE Update license to Apache v2 Jul 22, 2013
MANIFEST.in finishing touches before 3.0 release Sep 19, 2017
README.rst
requirements.txt remove requirement, readme additions Nov 3, 2016
setup.cfg Ticket CE-787 - Fixed doctstring, added doctest Jan 1, 2015
setup.py fix typo in development status Jun 22, 2018
tox.ini rm py34, add py37 Mar 21, 2019

README.rst

https://travis-ci.org/urbanairship/python-library.svg?branch=master

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 2.0.0, Python 2.7, 3.3 or 3.4 is required. 3.5 and 3.6 are also officially supported from version 3.0.0 on.

Functionality

Version 2.0.0 is a feature upgrade and backwards incompatible with versions earlier than 0.8. This release focuses on support for Web Notify and removes support for Blackberry and MPNS.

A more detailed list of changes can be found in the CHANGELOG.

Usage

See the full documentation for this library, 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.ios_channel('some_ios_channel'))
>>> push.notification = ua.notification(alert='Hello')
>>> push.device_types = ua.device_types('ios')
>>> push.send()

Broadcast to iOS and Android 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'))
>>> push.device_types = ua.device_types('ios', 'android')
>>> push.send()

Sending a rich app page to a single iOS device

>>> import urbanairship as ua
>>> airship = ua.Airship('application_key', 'master_secret')
>>> push = airship.create_push()
>>> push.audience = ua.ios_channel('some_ios_channel')
>>> 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()

Web Push to a tag

>>> import urbanairship as ua
>>> airship = ua.Airship('application_key', 'master_secret')
>>> push = airship.create_push()
>>> push.audience = ua.tag('web_tag')
>>> push.notification = ua.notification(alert='Hello')
>>> push.device_types = ua.device_types('web')
>>> push.send()

Questions

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

History

  • 5.0 Support for Sms and Email push. See changelog for other updates.
  • 4.0 Support for Automation, removed Feedback
  • 3.0 Support for Open Channels, several other significant changes
  • 2.0 Support for Web Notify and more iOS 10, stopped supporting Python 2.6
  • 1.0 Support for In-App and iOS 10
  • 0.8 Support for Reports APIs
  • 0.7 Support for Python 3, major refactoring
  • 0.6 Major refactoring, support for push api v3
  • 0.5 Added Android, Rich Push, and scheduled notifications
  • 0.4 Added batch push
  • 0.3 Added deregister, device token list, other minor improvements
  • 0.2 Added tags, broadcast, feedback
  • 0.1 Initial release

See the CHANGELOG file for more details.

You can’t perform that action at this time.