Tap on link in Facebook App doesn't start my Android app - Stack Overflow

admin2025-04-18  4

I have an Android app which can process external links. I added this to my Android manifest:

            <intent-filter android:label="Verification_Stage" 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="https" android:host="stage.nextship" android:pathPrefix="/profile/billing"
                    tools:ignore="IntentFilterUniqueDataAttributes" />
                <data android:scheme="https" android:host="stage.nextship" android:pathPrefix="/vacancy"
                    tools:ignore="IntentFilterUniqueDataAttributes" />
</intent-filter>

When I click a link like this in gmail or any other app My app starts and processes this link. Everything works fine

But when I post such a link in Facebook and use Facebook app to open my link it goes to Facebook internal browser. If i go to menu and select View in external browser, my app starts. I dug Internet and found that my web-page should contain metadata in order Facebook to process it correctly and start app. So on my web-page I added this code:

<meta property="al:android:package" content="my.package.name">
<meta property="al:android:app_name" content="MyAppName">
<meta property="al:android:url" content=";>

of course I used correct package name and app name. And I triple checked that the names are correct. But it didn't help. I tried not to use al:android:url or use it in different variants. But it doesn't work. What am I doing wrong?

UPD: The problem seemed to be with caching. When I made a completely new post on Facebook it started to work. But if I post only a link in my post then the link leads to my app. If a post a text and a link inside it it leads to Facebook internal browser.

I have an Android app which can process external links. I added this to my Android manifest:

            <intent-filter android:label="Verification_Stage" 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="https" android:host="stage.nextship.net" android:pathPrefix="/profile/billing"
                    tools:ignore="IntentFilterUniqueDataAttributes" />
                <data android:scheme="https" android:host="stage.nextship.net" android:pathPrefix="/vacancy"
                    tools:ignore="IntentFilterUniqueDataAttributes" />
</intent-filter>

When I click a link like this in gmail or any other app https://stage.nextship.net/vacancy?id=10444 My app starts and processes this link. Everything works fine

But when I post such a link in Facebook and use Facebook app to open my link it goes to Facebook internal browser. If i go to menu and select View in external browser, my app starts. I dug Internet and found that my web-page should contain metadata in order Facebook to process it correctly and start app. So on my web-page I added this code:

<meta property="al:android:package" content="my.package.name">
<meta property="al:android:app_name" content="MyAppName">
<meta property="al:android:url" content="https://stage.nextship.net/vacancy">

of course I used correct package name and app name. And I triple checked that the names are correct. But it didn't help. I tried not to use al:android:url or use it in different variants. But it doesn't work. What am I doing wrong?

UPD: The problem seemed to be with caching. When I made a completely new post on Facebook it started to work. But if I post only a link in my post then the link leads to my app. If a post a text and a link inside it it leads to Facebook internal browser.

Share Improve this question edited Jan 30 at 11:22 Al Sh asked Jan 29 at 12:57 Al ShAl Sh 511 silver badge4 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

as I know al:android:url should match your intent filter’s data URI format. currently your elements are expecting https://stage.nextship.net/vacancy but in tag, you are using nxtshp://stage.nextship.net/vacancy.

try this, it might fix the problem:

<meta property="al:android:url" content="https://stage.nextship.net/vacancy">
转载请注明原文地址:http://www.anycun.com/QandA/1744964614a90122.html