Sagar Zala
Sagar Zala

Reputation: 5144

How to open and pass data from Native Android App to Flutter Android App?

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

Upvotes: 1

Views: 2318

Answers (1)

Nikhil Vadoliya
Nikhil Vadoliya

Reputation: 1588

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

Upvotes: 1

Related Questions