WhatsApp doesn’t show usernames on notifications
The reason you’re not seeing the names of those users sending you WhatsApp messages is because you haven’t got previews enabled in your Notification settings.

To do this:


Go to Settings > Notifications 
At the top tap on the Show Previews option
Now select the option you want generally across all your apps (i.e. Always, When Unlocked, or Never)
Now go back to the main Notifications screen
Swipe up until you see the WhatsApp option
Tap on WhatsApp
Now at the very bottom of your WhatsApp Notifications settings you’ll have options relating to Previews - set this to Never if you don't want the actual message included in the Preview
Exit Settings
Launch WhatsApp and within its Settings go to Notifications and enable Show Preview (this step in combination with choosing Never at Step 7 will enable the contact name to be displayed in the preview, but not the message itself)


Note: You can skip steps 2 to 4 if you only want to set Preview settings for WhatsApp.