def _render_android(self, payload):
        """ Android specific options for messages sent through FCM connection server

        https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#androidconfig
        """
        Payload._set_payload_value(payload, 'priority', PlatformPayloadPriority.android.get(self.priority, None))
        Payload._set_payload_value(payload, 'collapse_key', self.collapse_key)
    def test_set_payload_value(self):
        data = {}

        Payload._set_payload_value(data, 'one', None)
        self.assertEqual(data.get('one', 'test-default'), 'test-default')

        Payload._set_payload_value(data, 'one', 'two')
        self.assertEqual(data.get('one', 'test-default'), 'two')
    def _render_apns(self, payload):
        """ Apple Push Notification Service specific options

        https://goo.gl/MXRTPa
        https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#ApnsConfig
        """
        Payload._set_payload_value(payload, 'apns-priority', PlatformPayloadPriority.apns.get(self.priority, None))
        Payload._set_payload_value(payload, 'apns-collapse-id', self.collapse_key)
    def _render_webpush(self, payload):
        """ Webpush protocol options

        https://tools.ietf.org/html/rfc8030
        https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#WebpushConfig
        """
        Payload._set_payload_value(payload, 'Urgency', PlatformPayloadPriority.web.get(self.priority, None))
        Payload._set_payload_value(payload, 'Topic', self.collapse_key)
    def _render_android(self, payload):
        """ Android specific options for messages sent through FCM connection server

        https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#androidconfig
        """
        Payload._set_payload_value(
            payload, 'priority',
            PlatformPayloadPriority.android.get(self.priority, None))
        Payload._set_payload_value(payload, 'collapse_key', self.collapse_key)
    def _render_webpush(self, payload):
        """ Webpush protocol options

        https://tools.ietf.org/html/rfc8030
        https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#WebpushConfig
        """
        Payload._set_payload_value(
            payload, 'Urgency',
            PlatformPayloadPriority.web.get(self.priority, None))
        Payload._set_payload_value(payload, 'Topic', self.collapse_key)
    def _render_apns(self, payload):
        """ Apple Push Notification Service specific options

        https://goo.gl/MXRTPa
        https://firebase.google.com/docs/reference/fcm/rest/v1/projects.messages#ApnsConfig
        """
        Payload._set_payload_value(
            payload, 'apns-priority',
            PlatformPayloadPriority.apns.get(self.priority, None))
        Payload._set_payload_value(payload, 'apns-collapse-id',
                                   self.collapse_key)