How to use the pyfcm.fcm.FCMNotification function in pyfcm

To help you get started, we’ve selected a few pyfcm examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github olucurious / PyFCM / pyfcm / extensions / tornado.py View on Github external
success = parsed_response.get('success', 0)
        failure = parsed_response.get('failure', 0)
        canonical_ids = parsed_response.get('canonical_ids', 0)
        results = parsed_response.get('results', [])
        message_id = parsed_response.get('message_id', None)  # for topic messages
        if message_id:
            success = 1

        return {'multicast_id': multicast_id,
                'success': success,
                'failure': failure,
                'canonical_ids': canonical_ids,
                'results': results}


class TornadoFCMNotification(FCMNotification, TornadoBaseAPI):
    @gen.coroutine
    def notify_single_device(self,
                             registration_id=None,
                             message_body=None,
                             message_title=None,
                             message_icon=None,
                             sound=None,
                             condition=None,
                             collapse_key=None,
                             delay_while_idle=False,
                             time_to_live=None,
                             restricted_package_name=None,
                             low_priority=False,
                             dry_run=False,
                             data_message=None,
                             click_action=None,