Also, how the fuck did China have telegraphs before pinyin alphabetization?
Edit: There, happy now?
You sub-question about telegraphs and pinyin is really a separate question, but it's also a pretty heavily biased one. You're getting a number of responses that are just regurgitations of a Wikipedia search result and have thus been removed, as will other low-effort replies.
That said, the initial formulation of the question about pinyin isn't really ideal. There's not anything inherent to pinyin (assuming you mean hanyu pinyin) that would give reason to expect its existence in China before the introduction of telegraphy in the 1870s. It implies a linearity to history which just isn't there. You might have better luck if you can reformulate the question.
edit:
Also, how the fuck did China have telegraphs before
pinyinalphabetization?
I mean, it's still problematic for the exact same reason. There's not anything inherent to alphabetisation that would give reason to expect its existence in China before the introduction of telegraphy in the 1870s.