| Home | Trees | Indices | Help |
|
|---|
|
|
object --+
|
AbstractClient
Abstract client for sending push notifications. Inherit from this
class but don't call it directly.
Member Vars:
developerkey: A string containing a valid developer key for the
client's application.
application: A string containing the name of the application on
behalf of whom the client will be sending messages.
apikeys: A dictionary where the keys are strings containing
valid user API keys, and the values are lists of strings,
each containing a valid user device key.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Inherited from |
|||
|
|||
|
Inherited from |
|||
|
|||
Initialize the client.
Args:
developerkey: A string containing a valid developer key for
the client's application.
application: A string containing the name of the application
on behalf of whom the client will be sending messages.
|
Add the given key to self.apikeys.
Args:
apikey: A string containing a valid user's API key for the
client's application.
device_key: A string containing a valid device key to go
along with the API key. (default: '')
|
Delete the given API key or device key from self.apikeys.
If device_key is not set, delete apikey and all of its device
keys. Otherwise only delete the device key.
Args:
apikey: A string containing a valid user's API key that is
in self.apikeys.
device_key: A string containing a valid device key that is
in self.apikeys[apikey]. (default: '')
|
Send a notification to each user/device combination in
self.apikeys.
Args:
description: A string containing the main notification text.
The maximum length varies by application. See each
client's documentation for details.
event: A string containing a subject or brief description of
the event. The maximum length varies by application. See
each client's documentation for details.
split: A boolean indicating whether to split long
descriptions among multiple notifications (True) or to
raise an exception if it is too long (False).
(default True)
kwargs: A dictionary for application specific options. See
each client's documentation for details.
(default: None)
Raises:
pushnotify.exceptions.ApiKeyError
pushnotify.exceptions.FormatError
pushnotify.exceptions.RateLimitExceeded
pushnotify.exceptions.ServerError
pushnotify.exceptions.UnknownError
pushnotify.exceptions.UnrecognizedResponseError
|
Verify a device identifier for the user given by apikey.
Args:
apikey: A string containing a user identifer.
device_key: A string containing a device identifier.
Raises:
pushnotify.exceptions.ApiKeyError
Returns:
A boolean containing True if device_key is valid for
apikey, and False if it is not.
|
Verify a user's API key.
Args:
apikey: A string containing a user's API key.
Raises:
pushnotify.exceptions.RateLimitExceeded
pushnotify.exceptions.ServerError
pushnotify.exceptions.UnknownError
pushnotify.exceptions.UnrecognizedResponseError
Returns:
A boolean containing True if the user's API key is valid,
and False if it is not.
|
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Sun Feb 3 01:11:42 2013 | http://epydoc.sourceforge.net |