Deep linking to Facebook Messenger

As WizKid (FB Employee) said here:

...there is no documented way to interact with ... [Messenger] so anything you do may break at any second.

So with that in mind, it sounds like fb-messenger://user-thread/ID has been deprecated. That being said, I decompiled the Facebook Android APK and found a line:

return Uri.parse((new StringBuilder("fb-messenger://user/")).append(Uri.encode(s)).toString());

So from what I can see, it looks like fb-messenger://user-thread/ID has been replaced with fb-messenger://user/ID

There's also a line thats:

return Uri.parse((new StringBuilder("fb-messenger://thread/")).append(Uri.encode(s)).toString());

So fb-messenger://thread/ID may be valid too. ID could be a user or thread ID, I didn't dig deep enough to find out.

EDIT: Current Facebook URL is fb-messenger-public://user-thread/ID


All of this has changed. Facebook released short links to connect with a brand or user's Messenger profile. The way to direct link is http://m.me/PROFILE or PAGE_NAME

If you're building bots, you can also pass in a referral parameter. I've written a bunch about this linking in to Messenger conversations.


If you want to jump to code directly, here it is:

NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"https://m.me/%ld", USER_ID]];
if ([[UIApplication sharedApplication] canOpenURL:url]) {
    [[UIApplication sharedApplication] openURL:url];
}

Sorry to bring this back from the dead, but it seems that Facebook Messenger has incorporated Universal Links to quick open the Messenger app.

m.me/$USERNAME

for example: http://m.me/zuck will universally link you to message Zuckerberg.

I played with a couple params, but nothing seemed to prefill the message.