0

I am building one of the FB Messenger Bot applications and I want to send my apps custom URL into messenger for reply so that user can tap on it to open the app (The app is already installed on the device). This is app is not in the app store and just a demo for now.

Using Graph Send API, added button :

https://developers.facebook.com/docs/messenger-platform/send-api-reference/url-button

How can I achieve this ? When I am sending http://www.example.com in url payload it open in WebView not navigate to installed my android app.

Same url http://www.example.com other app open in my app. (Ex. gmail android app)

Thanks,

TejaDroid
  • 6,561
  • 4
  • 31
  • 38
Suhas Bachewar
  • 1,230
  • 7
  • 21

1 Answers1

1

@Suhas Bachewar,

To open your app from other app, you have to implement the deep-link

Please find the tutorial from here.

The following XML snippet shows how implement the deep-link, you might have to specify an intent filter in your manifest for deep linking.

The URIs “yourapp://droid” and “http://www.yourapp.com/droid” both resolve to this activity.

Accepts URIs that begin with "http://www.yourapp.com/droid

<activity
    android:name="com.yourapp.activity"
    android:label="@string/title" >
    <intent-filter android:label="@string/filter_title">
        <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"
              android:host="www.yourapp.com"
              android:pathPrefix="/droid" />
        <!-- note that the leading "/" is required for pathPrefix-->
        <!-- Accepts URIs that begin with "yourapp://droid” -->
        <data android:scheme="yourapp"
              android:host="droid" />
    </intent-filter>
</activity>
TejaDroid
  • 6,561
  • 4
  • 31
  • 38
  • Can you give me another link or any sample code for this. Actually https://codelabs.developers.google.com/codelabs/android-deep-linking/index.html?index=..%2F..%2Findex#0 can not run in studio., – Suhas Bachewar Dec 19 '16 at 10:28
  • for this you have to googling about the "Deep link", Also here one example may you get the solution of your question. https://github.com/airbnb/DeepLinkDispatch – TejaDroid Dec 19 '16 at 10:52