Yes. Definitely.
If I say "I literally broke my arm" after I actually broke my arm, that use is completely correct. But you cannot be literally dead and still type a message, unless it's an automated message that you ordered someone/something to send AFTER you died.