How To fix context.getSystemService(class) for api 21?

Thanks to Reghunandan I found a better solution for my problem by using:

github.com/firebase/firebase-jobdispatcher-android

But if any body got same problem here is the mistake:

getSystemService(Class) API 23

Should be:

getSystemService(String) API 1

getSystemService(context.JOB_SCHEDULER_SERVICE) API 21

Came here with a similar problem for NotificationManager. What I ended up doing was

 val notificationManager =
                ContextCompat.getSystemService(
                    requireContext(),
                    NotificationManager::class.java
                ) as NotificationManager