I have a factory unlocked iPhone 4. It was running iOS 5.0.1 and has a T-Mobile SIM in it. Voice, text, data and MMS all work as expected.
This morning, I was unable to activate iMessage. Several times, it got stuck “waiting for activation.” Eventually, it displayed an “Activation Failed” message.
I tried removing my Apple ID; sending messages to other iMessage users; turning WiFi off; changing the SMS service center and rebooting. None of these had any effect.
After reading some posts about enabling international text messages, I added $10 to my account. (Previously, I had a balance of 3¢, having already paid for the month.)
Once that was done, I was able to activate and use iMessage successfully. I re-enabled my AppleID and iMessage continued to work.