Receiving notification for new message on messaging app

I am developing a messaging app. Currently when the sender sends a message the senders phone receives notification of the message that was sent. Obviously it should be the receiver who receives this notification. Not sure what I'm doing wrong - can anyone help with this problem?

Again, I think it's probably best that we focus our discussions on your original thread.

Receiving notification for new message on messaging app
 
 
Q