I'm trying to add deep linking to my app, i'm using uni_links
I followed the instructions on the page, and on android emulator everything works fine- I open the app through the deep link, the snapshot has data and the urlResponse is returned, but on a real device, when I open the app through the deep link, the snapshot doesn't have any data and the HomePage is returned.
here is my code:
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
theme: ThemeData(
primaryColor: Colors.white,
visualDensity: VisualDensity.adaptivePlatformDensity,
),
home: StreamBuilder(
stream: getLinksStream(),
builder: (context, snapshot) {
if (snapshot.hasData) {
// our app started by configured links
Uri uri = Uri.parse(snapshot.data);
List<MapEntry<String, List<String>>> list =
uri.queryParametersAll.entries.toList();
return urlResponse(uri, list);
} else {
// our app started regularly
return HomePage();
}
},
),
);
}
and my AndroidManifest.xml:
<!-- Deep Links -->
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<!-- Accepts URIs that begin with YOUR_SCHEME://YOUR_HOST -->
<data
android:scheme="http"
android:host="example.com"
android:pathPrefix="/myApp"/>
</intent-filter>
Can anyone help me to understand why it's working on emulator but not on a real device?