0

So I am trying to make my app auto-start So to do this i have to redirect the user to the auto start screen of the devices. I tried calling intent similar as we get the battery detail app in flutter but it's not working, how to make app autostart any guidance will be helpful.github issue

what I am looking for an alternate way of using this intent to open auto-start screen in oppo

  Intent intent = new Intent();
                        intent.setClassName("com.coloros.safecenter",
                                "com.coloros.safecenter.startupapp.StartupAppListActivity");
                        startActivity(intent);

this is for Xiaomi

 Intent intent = new Intent();
            intent.setComponent(new ComponentName("com.miui.securitycenter",

   "com.miui.permcenter.autostart.AutoStartManagementActivity"));
                startActivity(intent)

this intent in flutter. I already looked into flutter intent

Neelay Srivastava
  • 1,041
  • 3
  • 15
  • 46

3 Answers3

0

I'm not sure what you are asking but to start an app from a flutter app you can use this package: https://pub.dev/packages/flutter_appavailability

here an exemple to open the mailBox app

try{
  AppAvailability.launchApp(Platform.isIOS ? "message://" : "com.google.android.gm").then((_) {
    print("App Email launched!");
  }).catchError((err) {
    print(err);
  });
} catch(e) {
  print(e);
}
Milvintsiss
  • 1,420
  • 1
  • 18
  • 34
  • No, I don't want to open any app I just want to open a specific screen in the settings through intent for that i need an intent related solution as we can not open settings without using intent. – Neelay Srivastava Mar 26 '20 at 14:44
0

I got your question. You can try the following for Xiaomi devices

static const platform = const MethodChannel('com.myapp/intent');

void openAutoStartSettings() async {
    await platform.invokeMethod('com.miui.permcenter.autostart.AutoStartManagementActivity');
}

For other manufacturers, please check this post https://tutel.me/c/programming/questions/48166206/how+to+start+power+manager+of+all+android+manufactures+to+enable+background+and+push+notification

0

You can use android_intent library for launching external app. Documentation has some sample codes. You may use sample code below.

var map={"AuthParams":authParam};
var intent=AndroidIntent(package:"in.app",arguments: map,componentName: "in.app.ui.splash.SplashActivity",/*action: "action_view"*/);
await intent.launch();