Skip to content

Background Service

Efra Espada edited this page Jun 6, 2018 · 1 revision

Rotor Core works in background in order to receive updates or messages when application is on background or foreground. You must add RotorService to your AndroidManifest.xml file:

<application>
    <service
        android:name="com.rotor.core.RotorService"
        android:enabled="true"
        android:exported="true" />
</application>

This service is controlled when the application is present and must be bind or unbind. Add in activities:

@Override
protected void onResume() {
    super.onResume();
    Rotor.onResume();
}
 
@Override
protected void onPause() {
    Rotor.onPause();
    super.onPause();
}
override fun onResume() {
    super.onResume()
    Rotor.onResume()
}

override fun onPause() {
    Rotor.onPause()
    super.onPause()
}

Android Oreo is not supported yet. In the new Android version, all background services has been blocked. That means Rotor Core can't work (and Database and Notifications). Only Firebase Cloud Message service still working.
Clone this wiki locally