It is very difficult for new comer to develop background and foreground app with receiver instead of services in Android 13.
That is for 3 types of services in Android:
(1) Background
(2) Foreground
(3) Bound
I request to post 3 types of seperate examples as explained in below site preferably with mqtt connection for iot apps