Yes, you can set up your own notification service but it’s more complicated than using third party services, you can send push notifications directly on iOS using Apple Push Notification and MQTT for Android.
You can also check this answer on how to setup MQTT