Using the original by @NishDoItAll to improve upon some aspects, such as the ability to circumvent not being able to pick up new messages while your conversation is open. To ensure we can pick up on new messages, after we get a new message from a user we will instantly be able to delete his chat (keep in mind the conversation is kept on your mobile device). That way, when that user messages us again we will be able to pick up new messages, as WhatsApp for some reason removed the "close chat" X button from the right hand corner of the chat window, therefore you are not able to grab new messages if your chat with that user is the current one displayed on screen.
WATCH NishDoItAll's original youtube video here https://youtu.be/uTtELWy4uOI for the tutorial and be sure to give him props for the original idea and code!