1

I wants to open and get some data like (userid, token, etc.) in Flutter Android app from Native Android app.

I know that using Intent I can open and pass data with Package Name but how to retrieve in Flutter App?

How to make it possible?

Open Flutter app from Native App

5
  • Do you want open app by Native call ? and also pass data when you are open it? Commented May 16, 2020 at 5:27
  • Yes @NikhilVadoliya Commented May 16, 2020 at 5:43
  • look the intent documentation, probably in flutter you have just the same classes. PLUS both native and flutter apps must be installed on device for this to work Commented May 16, 2020 at 5:48
  • @MarcosVasconcelos, Yes but how can I get passed parameter in Flutter App? Commented May 16, 2020 at 5:59
  • @SagarZala have you solution? Commented Mar 31, 2021 at 1:49

1 Answer 1

1

We can open app by below code

//open app if app no background /killed
 val intent = context.packageManager.getLaunchIntentForPackage(context.packageName)
 intent!!.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT)
 context.startActivity(intent)

If you want to pass data from Native to Flutter then you should be implement MethodChannel/EventChannel

Refer below link for Native to Flutter Native to Flutter communication

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.