Boot app at startUp

Troubleshooting

Hello dear community.
I'm tearing my hair out trying to start my flutterFlow app at android startup, or at least call a custom action.
The aim being to reprogram my app's local reminders, which seem to be disabled by android on reboot.

If I'm not wrong, this task is impossible to do inside flutterFlow, so I exported my project and opened it inside Visual Studio Code.

It's the first time I dig into this kind of code.

What I did :
Added RECEIVE_BOOT_COMPLETED permission and a receiver entry on the AndroidManifest.xml

<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"/>

<application
        <receiver android:name=".BootReceiver" android:enabled="true" android:exported="false">
            <intent-filter>
                <action android:name="android.intent.action.BOOT_COMPLETED"/>
            </intent-filter>
        </receiver>
</application>

Added some folders to add a BootReceiver.java at the end :

[project]\android\app\src\main\java\com\myCompany\myApp\BootReceiver.java :

package com.myCompany.myApp;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import io.flutter.embedding.engine.FlutterEngine;
import io.flutter.embedding.engine.dart.DartExecutor;
import io.flutter.view.FlutterMain;
import io.flutter.plugin.common.MethodChannel;

public class BootReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(Context context, Intent intent) {
        if (Intent.ACTION_BOOT_COMPLETED.equals(intent.getAction())) {
            FlutterMain.startInitialization(context);
            FlutterEngine flutterEngine = new FlutterEngine(context);
            flutterEngine.getDartExecutor().executeDartEntrypoint(
                DartExecutor.DartEntrypoint.createDefault()
            );

            // Création du MethodChannel pour envoyer un message à Dart
            new MethodChannel(flutterEngine.getDartExecutor().getBinaryMessenger(), "newReboot")
                .invokeMethod("sendNotificationsMethod", null);

            flutterEngine.getLifecycleChannel().appIsResumed();
        }
    }
}

Then I modified the main.dart in order to receive the channel :

import 'package:flutter/services.dart';

  @override
  void initState() {
  ...
    onPhoneRestart();
  }

  void onPhoneRestart() {
  MethodChannel channel = MethodChannel('newReboot');
  channel.setMethodCallHandler((MethodCall call) async {
    if (call.method == 'sendNotificationsMethod') {
      await actions.sendNotifications();
    }
  });

But then if I reboot the phone, my app is not called at all.

Do you have any ideas ?

Thanks a lot

What have you tried so far?

What was described upper.

Did you check FlutterFlow's Documentation for this topic?
Yes