Below is my attempt of connecting a speaker to the Photon using a transistor. I innitially connected the speaker directly to the Photon pin, but as @peekay123 and @Jack correctly pointed out, it was just a matter of time before I fried my GPIO.
Is this layout correct?
VCC: 5 Volts
Speaker: Input power: 0.7 Watt - Max: 1 Watt. Impedance: 8 Ohm
Transistor: MMBT 3904 LT1G
Tone function to call the speaker.