Circuit for magnetic switch

Might you mean a pull-down resistor when you mention "no resistor"?? I would expect a pull-down resistor is needed if the switch connects to the positive supply (unless the RN-XV GPIOs have programmable pull-downs?)