According to ex-Apple executive and now Nest founder, Tony Fadell, Apple had considered one of three core ideas for the iPhone, one of those? A hardware keyboard. He spoke in an evening session with The Verge, where he talked that the all-touch design that eventually materialised into the first iPhone had come after he wanted to try a virtual keyboard before resorting to the hardware option.
Being a key iPod architect, he understood the potential of an on-screen keyboard, which has its benefits such as disappearing when not needed, but didn't rule out physical keys at first. Whilst the iPhone was in development, there had been three different versions.
The all-touch iPhone that eventually became the number-one seller was joined by another model of an unknown layout as well as a third "iPod + Phone", implying that a design that more closely followed the iPod concept was once a consideration. At the time of the iPhone launch, the only experience with on-screen keyboards was with PalmOS and Windows Mobile-based devices. They used inprecise resistive touchscreens and their interfaces just weren't built to really make use of them the way that the iPhone and iOS ultimately did.