skip to Main Content

i already added this code in flutter app -> android -> src -> main -> androidmanifest.xml in this file but still now working

<!-- Intent filter for handling 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 "https://www.example.com/gizmos" -->
    <data
        android:scheme="https"
        android:host="www.example.com"
        android:pathPrefix="/gizmos" />
</intent-filter>

after adding this still not working

2

Answers


  1. Ensure the intent filter is placed within the tag that you want to handle the deep links. It should be nested inside the tag, not just anywhere in the AndroidManifest.xml.

    <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="your.package.name">
    <application>
        <activity android:name=".MainActivity">
            <!-- ... other configurations ... -->
    
            <!-- Intent filter for handling 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 "https://www.example.com/gizmos" -->
                <data
                    android:scheme="https"
                    android:host="www.example.com"
                    android:pathPrefix="/gizmos" />
            </intent-filter>
        </activity>
    
        <!-- ... other activities ... -->
    </application>
    
    Login or Signup to reply.
  2. you have to add uni_link package in project first

    import 'package:uni_links/uni_links.dart';void main() {  runApp(MyApp());}class MyApp extends StatefulWidget {  @override  MyAppState createState() => MyAppState();}class _MyAppState extends State<MyApp> {  @override  void initState() {    super.initState();    initUniLinks();  }  void initUniLinks() async {    String initialLink = await getInitialLink();    // Handle the initial link, e.g., by navigating to a specific screen  }  @override  Widget build(BuildContext context) {    // Your app's build method  }}
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search