Installing pipe pullup bar between beams
Much better to go with screws for several reasons, especially that they can be adjusted tight and will stay there, while nails will only set until the head hits the surface of the metal flange and also they have low withdrawal strength. Yes, most of your force is shear but because there is not much preventing the nails from pulling out, over time the nails will tend to loosen.

I suggest using a structural lag screw with around 2" of embed into the wood after accounting for the thickness of the flange. I suggest Simpson SDS x 2-1/2". A good quality #8 or #10 screw would work too. I strongly suggest not using cheap or low strength screws such as those used for dry wall.