I have restricted background data but i am still getting whatsapp and facebook messages,,, am using an android 8.1 oreo I have restricted background data but i am still getting Whatsapp and Facebook messages notifications.

I'm using an android 8.1 Oreo.
Push messages are usually not received by the app itself, but by the Google Push Notification Service (part of the "Google [Play] Services"). This prevents that every app have to built their own notification system which would cost a lot of battery and traffic.