I'm using react native with expo SDK (0.48) and I'm trying to make some modifications to my app to automatically boot it at the startup of the tablet (I'm making a kiosk for Android).
So far I'm looking at https://stackoverflow.com/a/6392009/5320409 and https://www.geeksforgeeks.org/how-to-launch-an-application-automatically-on-system-boot-up-in-android/
With that in mind, I started creating a custom configuration plugin
import {
AndroidConfig,
ConfigPlugin,
withAndroidManifest,
} from "expo/config-plugins";
export const withAutoStart: ConfigPlugin = (config) => {
return withAndroidManifest(config, async (props) => {
config = AndroidConfig.Permissions.withPermissions(config, [
"android.permission.RECEIVE_BOOT_COMPLETED",
]);
return props;
});
};
But I'm struggling to go further, does anyone has experience with that or has made such plugin? Or just some guidance on what I should look at? I'm not even sure a plugin is enough as it seems I need to make a .java
file for the BroadcastReceiver... Thanks.