You might not have enough capacitors causing brown outs when the relay is in action. I always make sure to put a 470uF capacitor on my Photon Vin for good measure. Make sure each chip has bypass capacitors (i.e. a 4.7uF and .1 uF in parallel). You probably want bypass capacitors on the I/O pins or a small RC circuit to suppress feedback and spurious signals (similar to debounce circuits). You could go so far as to put a Schottky and/or Zener diodes on the I/O lines to suppress ringing as well. Make sure your other I/O signal lines are as far away from the magnetics/relay as possible. A little shielding between signal lines could help. If your lines are long, use twisted pairs and make sure the signal is twisted with the supply voltage or ground (as opposed to twisting 2 signal/IO lines together).
This is all speculation since you haven’t shown a schematic or picture of your setup. If you have a multi-meter (or better yet an oscilloscope), test and monitor the voltages on the I/O pins that are getting tripped. You can also monitor the supply voltage to the Photon for dips or spikes.