Reputation: 5144
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?
Upvotes: 1
Views: 2318
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