The general rule of thumb is NEVER to resign unless you have the visa in your hand. You should not have shared this information without getting the visa, with your friend. What he is saying to you is also not appropriate as he is mixing a personal confidence with professional commitment.
My advice would be NOT to resign or even indicate resignation until you have the visa. Just tell your friend that you passed up on the job offer if he continues to pester you. And in the future, keep such matters to yourself and don't disclose - the more you share, the tougher the situation you put yourself in.