Are mandatory notifications GDPR compliant?

I have designed a notification center for my app. I would like to make sure users can't turn - off some types of in-app notifications: comments and replies.

Our app should be GDPR compliant. Is it okay to keep some of the notification types mandatory? Should users be able to turn-off all in-app notifications?