Reputation: 2028
The deeplinking works fine from WhatsApp, Slack and even Facebook Messenger but doesn't work from the Facebook App itself.
In the branch.io Link Settings I did enable:
Facebook developer settings:
Android App Versions:
Example link: sharing.kptncook.com/pIbQ/FKktug85TE
Activity part of Manifest:
<activity android:name=".MainActivity"
android:launchMode="singleTask">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter>
<data android:scheme="kptncook" android:host="open" />
<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="sharing.kptncook.com" />
<data android:scheme="http" android:host="sharing.kptncook.com" />
</intent-filter>
</activity>
<receiver android:name="io.branch.referral.InstallListener" android:exported="true">
<intent-filter>
<action android:name="com.android.vending.INSTALL_REFERRER" />
</intent-filter>
</receiver>
Activity:
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
@Override
public void onStart() {
super.onStart();
Branch branch = Branch.getInstance();
branch.initSession(new Branch.BranchReferralInitListener(){
@Override
public void onInitFinished(JSONObject referringParams, BranchError error) {
}
}, this.getIntent().getData(), this);
}
@Override
public void onNewIntent(Intent intent) {
this.setIntent(intent);
}
}
Additional info: In the emulator some links won't open and some does. If I send a link that doesn't work from the emulator to a real device it works on the real device.
What am I doing wrong?
Update: New shared links work now on the Real device in both Facebook Messenger and Main App. But if I open the exact same link in the messenger on an emulator it redirects to "r31v.test-app.link..." and doesn't show anything except a toast "Can't load page". It's so frustrating. Any ideas how to debug it?
Upvotes: 1
Views: 1465
Reputation: 13613
Alex from Branch.io here:
Facebook deep linking is one of the hardest things to debug — they intentionally don't want users to leave their app, wherever possible.
A few notes for debugging:
The domain r31v.test-app.link
is your original link domain. You customized this to sharing.kptncook.com
, but there are times when Branch needs to use both to handle certain edge cases. You need to add the following lines to your Manifest:
<data android:scheme="https" android:host="r31v.test-app.link" />
<data android:scheme="https" android:host="r31v-alternate.test-app.link" />
Other than the above, your in-app configuration implementation looks fine.
Feel free to reach out to our Integrations team any time with questions!
Upvotes: 2