2017-08-22 5 views
0

Ce ne fonctionne pasfiltre intention ne pas fonctionner avec l'hôte

<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="foosubdomain.foodomain.com"/> 
    </intent-filter> 

Il fonctionne. Mais je n'ai pas besoin de toutes les urls.

<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="*"/> 
</intent-filter> 

L'adresse URL doit être ouverte à partir des programmes de messagerie. url a une telle structure: http://foosubdomain.foodomain.com/#object?id=e1162d22-222b-4522-2210-c222102d6022

Utilisation dans un projet Qt/C++. Testé avec Qt 5.8.0, 5.9.1

p.s. Il semble que le problème se pose parce que le serveur de messagerie insère des informations pour la redirection. Il se trouve que j'ai déjà une autre question qui ne correspond pas à l'en-tête ... Comment filtrer l'URL en fonction du lien redirigé?

https://mail.mymailserver.ru/m/redirect?url=http%3A//foosubdomain.foodomain.com/%23object%3Fid%3De1162d22-222b-4522-2210-c222102d6022

Répondre

0

Dans le documentation for IntentFilter, les règles de filtrage sont expliquées en détail gore. Notez ceci:

Si vous spécifiez un régime, mais aucun type, seule intention qui ne dispose pas d'un type (comme mailto :) correspondra; un contenu: URI ne correspondra jamais car ils ont toujours un type MIME qui est fourni par leur fournisseur de contenu .

Il semble que vous deviez fournir un filtre de type.