Restarting your iPhone can fix a problem if it keeps turning on and off. If your iPhone shuts off suddenly, check its battery ...