0

When coming back to my app with an deeplink i need to select the app i want to open. The app is only installed once and the device is a fresh emulator. select an app dialog

I looked in my AndroidManifest.xml to see if the intent-filter was present more than once. Here is the code:

<activity
    android:name=".MainActivity"
    android:launchMode="singleInstance"
    android:theme="@style/LaunchTheme"
    android:hardwareAccelerated="true"
    android:windowSoftInputMode="adjustResize"
    android:exported="true">
    <!-- Specifies an Android theme to apply to this Activity as soon as
         the Android process has started. This theme is visible to the user
         while the Flutter UI initializes. After that, this theme continues
         to determine the Window background behind the Flutter UI. -->
    <meta-data
      android:name="io.flutter.embedding.android.NormalTheme"
      android:resource="@style/NormalTheme"
      />
    <intent-filter>
        <action android:name="android.intent.action.MAIN"/>
        <category android:name="android.intent.category.LAUNCHER"/>
    </intent-filter>
    <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="com.myapp.name"
            android:host="oauth2_redirect" />
        </intent-filter>
    </activity>

1 Answers1

0

So, you're correct that when you add singleInstance it should work but you need to write how you're link will look like in androidManifest file

Eg:

 <intent-filter android:label="testDeepLinkNFC">
                 <action android:name="android.nfc.action.NDEF_DISCOVERED" />
                 <category android:name="android.intent.category.DEFAULT" />
                 <data
                     android:scheme="https"
                     android:host="mydeeplink.page.link" /> //You need to write you deep linking point here
             </intent-filter>
Rohan Jariwala
  • 1,564
  • 2
  • 7
  • 24
  • Hello Rohan! My problem is that i need to select which app i want to open when i receive the link. On upper one the app opens and processes the uri correctly, but on the lower one the app opens and nothing appens. – Matthias Schaffer Apr 04 '23 at 18:23