software is fun software is fun - 11 months ago 298
iOS Question

Custom URL to launch Facebook Messenger on iOS

How can I launch FaceBook Messenger (if installed) with a compose Windows to a specific FB ID.

If messenger is not installed, can we launch FaceBook app and have the compose Windows open to a specific FB ID.

In the rare instance if no Facebook apps are installed, can we launch mobile Safari with the compose window?

tia tia
Answer Source

The URL scheme is fb-messenger://user-thread/{user-id}. I just build my app with fb-messenger URL scheme as Viewer and trapped the URL on the UIApplication delegate. The user-id parameter is long integer one, as in https://developers.facebook.com/docs/graph-api/reference/user/

enter image description here