react-navigation / react-navigation/react-navigation.github.io

is android:autoVerify="true" placed in the correct intent-filter?

Ouverte
#1,184 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Langage dominant
JavaScript
Étoiles
324
Forks
2k
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

deep link setup for android: https://reactnavigation.org/docs/deep-linking/#setup-on-android

says/shows:

Add android:autoVerify="true" to your entry

and this will be the resulst:

<activity
    android:name=".MainActivity"
    android:launchMode="singleTask">
    <intent-filter android:autoVerify="true">
        <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" />
        <data android:scheme="mychat" />
    </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" />
        <data android:scheme="http" />
        <data android:scheme="https" />
        <data android:host="www.example.com" />
    </intent-filter>
</activity>

here they are placed on the first intent-filter.

however, when looking at the android docs for android app links: https://developer.android.com/training/app-links#android-app-links

they dont place android:autoVerify="true" on the entry(first) intent-filter where we have:

<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />

they place android:autoVerify="true" on the intent-filter where we add the scheme and host, which is the third one in the react-navigation example.

so their example looks like this:

<intent-filter android:autoVerify="true">
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.DEFAULT" />
    <category android:name="android.intent.category.BROWSABLE" />

    <data android:scheme="http" />
    <data android:scheme="https" />

    <data android:host="myownpersonaldomain.com" />
</intent-filter>

so there is a difference in where react-navigation docs and android docs add android:autoVerify="true".

i believe to match the android docs, react-navigation docs example would have to be updated to:

<activity
    android:name=".MainActivity"
    android:launchMode="singleTask">
-   <intent-filter android:autoVerify="true">
+   <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" />
        <data android:scheme="mychat" />
    </intent-filter>
-   <intent-filter>
+   <intent-filter android:autoVerify="true">
        <action android:name="android.intent.action.VIEW" />
        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <data android:scheme="http" />
        <data android:scheme="https" />
        <data android:host="www.example.com" />
    </intent-filter>
</activity>

thoughts?

EDIT:

i just found this: https://developer.android.com/training/app-links/verify-android-applinks#auto-verification

which says:

When android:autoVerify="true" is present in at least one of your app's intent filters, installing your app on a device that runs Android 6.0 (API level 23) or higher causes the system to automatically verify the hosts associated with the URLs in your app's intent filters.

so maybe its not important which intent-filter you place android:autoVerify="true" after all?

EDIT 2:
from my own personal testing, my android app links only open the app when i place it the way the android docs show. it does not work when i place i the place react-navigation shows.

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Commencez par la page de configuration Android des deep links liée dans l’issue et comparez ses indications concernant intent-filter avec la documentation Android app-links. Localisez la source correspondante de la documentation React Navigation, vérifiez quel filtre doit contenir autoVerify au vu du comportement signalé, puis mettez à jour l’exemple et l’explication afin que la configuration documentée soit dépourvue d’ambiguïté.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
android, react-native
Domaine
documentation
Type d'issue
Documentation
Difficulté
3/5
Temps estimé
1-2 jours
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
48/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.