HI suhailbvr,
It sounds like you are not getting notifications when your phone is locked but when it is unlocked it is fine. I would check what you have your Notifications set to in your Settings:
About Notifications on iPhone, iPad, and iPod touch
https://support.apple.com/en-us/HT201925
Push notifications require an active Wi-Fi or cellular connection. If you’re not getting notifications for a specific app, try these steps:
- Go to Settings > Notifications to verify that the app supports notifications. If notifications do not appear in the Notification Center, make sure that the Notification Center setting for the app is enabled.
- Make sure you’re signed in to your Apple ID.
- If you’ve recently installed an app or restored a backup, open the app to start getting notifications.
It is possible you may also have Do Not Disturb on:
Use Do Not Disturb on your iPhone, iPad, or iPod touch
https://support.apple.com/en-us/HT204321
Thank you for using Apple Support Communities.