I'm trying to implement Facebook Deferred linking to the Android app.
The MainActivity has the following manifest:
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<category android:name="android.intent.category.DEFAULT" />
<data android:scheme="fb<my_app_id>" />
<data android:host="mycustomdomain.com"></data>
<data android:scheme="http" />
<data android:scheme="https"/>
</intent-filter>
My Java code
AppLinkData.fetchDeferredAppLinkData(MainActivity.activity,
new AppLinkData.CompletionHandler() {
@Override
public void onDeferredAppLinkDataFetched(AppLinkData appLinkData) {
Log.i("TEST", "Entering deep links");
if (AppLinks.getAppLinkData(MainActivity.activity.getIntent()) != null) {
Log.i("TEST", "Entering deep links");
}
}
}
);
The example URL that I add to the Facebook add tester is fb://mycustomdomain.com/index.php
The mycustomdomain.com/index.php
is just a webpage that I will be using in the Java code to send GET request and fetch some additional info from it.
Do I need to setup a service for example Firebase Dynamic Links for this to work?
The app is not on the store at the moment so I'm testing it on my real device but from Android Studio Run/Debug. The flow is following:
1) From the Facebook apps tester on https://developers.facebook.com/tools/app-ads-helper send the deferred link.
2) Install the application and log in to the Facebook
3) The onDeferredAppLinkDataFetched returns null
If I have my app install and just test the deep link, Facebook notification pops up, I can launch my application, the onDeferredAppLinkDataFetched
is called and I get the deep link successfully.
Thanks