Seems there were some very ingenus folks around 80+ years ago. Pull the trigger-snap a photo! Morbid? Odd? No-one seems to know much about it, not even who made it or why. It originated in New York, apparently snapped at least six photos with an unloaded gun, (a Colt Police Positive Special .38 Special revolver). Gun and camera currently resides at The National Archives of the Netherlands.
From my personal experience with firearms, I'll say it probably wasn't very successful, with live ammunition at least. There would be movement of the gun from the trigger pull and recoil of the cartridge firing, plus a certain amount of smoke and debris from both the barrel in front of the camera, and the barrel/cylinder gap behind it. Nor would I expect the camera in that time period to last long with such use.
Here's a link to the article. Colt camera revolver