I looked at it more as socializing them to noise as opposed to focusing just on gunfire. When our pup was very young, I started with a cap pistol, hammering nails and other power tools. Last summer, I build a shed and she was in the yard when I used the nail gun, hammering, dropping boards. She is so curious and ended up sniffing at the nail gun when I was firing it off.
Fourth of July is another good time, I took her outside and every big boom I fed her a treat. She was scared, but took the treats and I think it helped.
The first gunfire was at a shooting range (dirt pit style). I had her in the truck and then out of the truck but not very close to the gun.
When we finally got into a duck blind, she didn't mind the gunfire at all.