diff --git a/pyfcm/__meta__.py b/pyfcm/__meta__.py index 4465f4c..932e00d 100644 --- a/pyfcm/__meta__.py +++ b/pyfcm/__meta__.py @@ -2,7 +2,7 @@ __summary__ = "Python client for FCM - Firebase Cloud Messaging (Android, iOS and Web)" __url__ = "https://github.com/olucurious/pyfcm" -__version__ = "2.0.2" +__version__ = "2.0.3" __author__ = "Emmanuel Adegbite" __email__ = "olucurious@gmail.com" diff --git a/pyfcm/baseapi.py b/pyfcm/baseapi.py index 19bd804..7fb334f 100644 --- a/pyfcm/baseapi.py +++ b/pyfcm/baseapi.py @@ -192,7 +192,9 @@ def parse_response(self, response): return response.json() elif response.status_code == 401: - raise ("There was an error authenticating the sender account") + raise AuthenticationError( + "There was an error authenticating the sender account" + ) elif response.status_code == 400: raise InvalidDataError(response.text) elif response.status_code == 404: diff --git a/pyfcm/fcm.py b/pyfcm/fcm.py index e340f40..ca3f945 100644 --- a/pyfcm/fcm.py +++ b/pyfcm/fcm.py @@ -5,7 +5,7 @@ class FCMNotification(BaseAPI): def notify( self, - fcm_token, + fcm_token=None, notification_title=None, notification_body=None, notification_image=None, @@ -23,7 +23,7 @@ def notify( Send push notification to a single device Args: - fcm_token (str): FCM device registration ID + fcm_token (str, optional): FCM device registration ID notification_title (str, optional): Message title to display in the notification tray notification_body (str, optional): Message string to display in the notification tray notification_image (str, optional): Icon that appears next to the notification