The wire from your truck is not very big. Maybe 16 awg at most. It wont carry enough current to really charge your battery. It will provide enough current to keep a small battery charged for brake power if the trailer separates from the tow vehicle.
If you really want to charge the battery run a 10 or 12 AWG wire and install something like this.
https://www.wirthco.com/20090.html there are others this is just one type