'Add a notification message to the frame'

def add_item(self, token_hex, payload, identifier, expiry, priority):

    item_len = 0
    self.frame_data.extend(('\x02' + APNs.packed_uint_big_endian(item_len)))
    token_bin = a2b_hex(token_hex)
    token_length_bin = APNs.packed_ushort_big_endian(len(token_bin))
    token_item = (('\x01' + token_length_bin) + token_bin)
    self.frame_data.extend(token_item)
    item_len += len(token_item)
    payload_json = payload.json()
    payload_length_bin = APNs.packed_ushort_big_endian(len(payload_json))
    payload_item = (('\x02' + payload_length_bin) + payload_json)
    self.frame_data.extend(payload_item)
    item_len += len(payload_item)
    identifier_bin = APNs.packed_uint_big_endian(identifier)
    identifier_length_bin = APNs.packed_ushort_big_endian(len(identifier_bin))
    identifier_item = (('\x03' + identifier_length_bin) + identifier_bin)
    self.frame_data.extend(identifier_item)
    item_len += len(identifier_item)
    expiry_bin = APNs.packed_uint_big_endian(expiry)
    expiry_length_bin = APNs.packed_ushort_big_endian(len(expiry_bin))
    expiry_item = (('\x04' + expiry_length_bin) + expiry_bin)
    self.frame_data.extend(expiry_item)
    item_len += len(expiry_item)
    priority_bin = APNs.packed_uchar(priority)
    priority_length_bin = APNs.packed_ushort_big_endian(len(priority_bin))
    priority_item = (('\x05' + priority_length_bin) + priority_bin)
    self.frame_data.extend(priority_item)
    item_len += len(priority_item)
    self.frame_data[((- item_len) - 4):(- item_len)] = APNs.packed_uint_big_endian(item_len)
    self.notification_data.append({'token': token_hex, 'payload': payload, 'identifier': identifier, 'expiry': expiry, 'priority': priority})
