Usually it happens because of a poor quality app or due to software issues. Read the above troubleshoots to fix random iPhone restarting problem.