Custom Url to Launch Facebook Messenger on iOS

Custom URL to launch Facebook Messenger on iOS

sample ,It's work for me in ios

let msgUrl = URL(string: "http://m.me/{PAGE_NAME}")
UIApplication.shared.openURL(msgUrl)

reference in document of dev facebook : https://developers.facebook.com/docs/messenger-platform/discovery/m-me-links/

What are all the custom URL schemes supported by the Facebook iPhone app?

June 2014 EDIT: Here is the updated list from Facebook v12:

fb://album?id=%@
fb://background_location
fb://browse?semantic=%@&result_type=%d&source_type=%d&title=%@
fb://codegenerator
fb://composer?%@
fb://composer?pagename=%@&pageid=%@
fb://composer?target=%@
fb://composer?view=location
fb://contactimporter/?ci_flow=%d
fb://discovery
fb://entitycards/?ids=%@&source=%@
fb://event?id=%@
fb://event?id=%@&post_id=%@
fb://eventguestlist?event_id=%@
fb://events/list
fb://eventslist?owner_fbid=%@
fb://f(.+)(\?|&)v=map(\&.*)?
fb://f(.+)incorrect_map_pin(\&.*)?
fb://friendsnearby
fb://friendsnearby/?source=%@
fb://friendsnearby/?source=divebar
fb://friendsnearby/ping?fbid=%@&source=%@
fb://friendsnearby/profile?fbid=%@&source=%@
fb://gift?
fb://group?id=%@
fb://group?id=%@&object_id=%@&view=permalink
fb://hashtag/
fb://hashtag/%@
fb://location_settings
fb://messageComposer?
fb://messaging/new
fb://messaging/new?id=%@&name=%@&isPage=%d
fb://messaging?
fb://messaging?id=%@
fb://messaging?id=%@&%@
fb://messaging?tid=%@
fb://messaginglist
fb://page?id=%@
fb://page?id=%@&source=%@&source_id=%@
fb://page_about?id=%@
fb://page_friend_likes_and_visits?id=%@
fb://page_reviews?id=%@
fb://photo?%@
fb://photo?id=%@
fb://pnp?type=instructions
fb://products?%@
fb://profile
fb://profile/%@
fb://profile?id=%@
fb://profile?id=%@&%@=%@
fb://story?%@
fb://story?graphqlid=%@
fb://story?id=%@
fb://timelineappsection?id=%@
fb://topic/%@
fb://uploadcoverphoto
fb://zrnext

April 2013 EDIT : Looks like none of below works anymore with latest versions, facebook app navigation probably has been rewrited. Some reverse engineering to do on latest version...

I guess that might help, that's from v3.4 :

fb://album/%@
fb://album/(aid)
fb://album/(aid)/cover
fb://album/(initWithAID:)
fb://album/(initWithAID:)/cover
fb://album/new
fb://albums
fb://birthdays
fb://birthdays/(initWithMonth:)/(year:)
fb://birthdays/(month)/(year)
fb://chat/(fbid)
fb://chat/(initWithUID:)
fb://chat/(user.fbid)
fb://contactimporter
fb://contactimporter/invites
fb://contactimporter/legalese
fb://contactimporter/modal
fb://event/%@
fb://event/%llu
fb://event/(event.fbid)/members/(rsvpStatus)
fb://event/(fbid)
fb://event/(fbid)/members/attending
fb://event/(fbid)/members/declined
fb://event/(fbid)/members/not_replied
fb://event/(fbid)/members/unsure
fb://event/(fbid)/rsvp
fb://event/(initWithEventId:)
fb://event/(initWithEventId:)/members/(rsvpStatus:)
fb://event/(initWithEventId:)/rsvp
fb://events
fb://events/
fb://faceweb/(initWithURL:)
fb://facewebmodal/(initWithURL:)
fb://feed
fb://feed/%@
fb://feed/(filter.filterKey)
fb://feed/(initWithFilterKey:)
fb://feedfilters
fb://findfriends
fb://findfriends/legalese
fb://findfriends/modal
fb://friends
fb://friends/picker
fb://friends/sync
fb://friends/sync/(removeData:)
fb://friends/sync/disconnect
fb://friends/sync/legalese
fb://group/(fbid)/members
fb://group/(initWithGroupId:)/members
fb://groups
fb://launcher
fb://mailbox
fb://mailbox/(folder)
fb://mailbox/(initWithFolder:)
fb://mailbox/(initWithFolder:)/(tid:)
fb://mailbox/(mailbox.folder)/(tid)
fb://mailbox/compose
fb://mailbox/compose/(fbid)
fb://mailbox/compose/(initWithUID:)
fb://map
fb://messaging
fb://messaging/(folder)
fb://messaging/(initWithFolder:)
fb://messaging/(initWithFolder:)/(tid:)/participants
fb://messaging/(initWithFolder:)/thread?tid=(tid:)
fb://messaging/(mailbox.folder)/(urlEscapedTid)/participants
fb://messaging/(mailbox.folder)/thread?tid=(urlEscapedTid)
fb://messaging/compose
fb://messaging/compose/(fbid)
fb://messaging/compose/(initWithUID:)
fb://messaging/original_message?mid=(commentId)
fb://messaging/original_message?mid=(initWithMessageId:)
fb://nearby
fb://note/%@
fb://note/(initWithNoteId:)
fb://note/(initWithNoteId:)/edit
fb://note/(noteId)
fb://note/(noteId)/edit
fb://note/compose
fb://notes
fb://notifications
fb://online
fb://online#offline
fb://online#online
fb://page/(page.id)
fb://pages
fb://photo/%@/0/%@
fb://photo/(album.user.fbid)/(album.aid)/(pid)
fb://photo/(album.user.fbid)/(album.aid)/(pid)/feedback
fb://photo/(fbid)/profilepic
fb://photo/(initWithProfilePicturesUID:)/profilepic
fb://photo/(initWithUID:)/(aid:)/(pid:)
fb://photo/(initWithUID:)/(aid:)/(pid:)/feedback
fb://photosapp
fb://place/%@
fb://place/(initWithPageId:)
fb://place/(targetId)
fb://place/addfriends
fb://place/addphoto
fb://place/create
fb://places
fb://places/%lld/%lld
fb://places/(initWithCheckinAtPlace:)/(byUser:)
fb://places/legalese/tagged/%lld/%lld
fb://places/legalese/tagged/(initWithTaggedAtPlace:)/(byUser:)
fb://post/%@
fb://post/%@_%@
fb://post/(initWithPostId:)
fb://post/(initWithPostId:)/tagged
fb://post/(postId)
fb://post/(postId)/tagged
fb://post/(postId)/untagSelf
fb://post/(untagSelfFromPostWithId:)/untagSelf
fb://profile
fb://profile/
fb://profile/%@
fb://profile/%lld
fb://profile/(addFan:)/addfan
fb://profile/(fbid)
fb://profile/(fbid)/addfan
fb://profile/(fbid)/addfriend
fb://profile/(fbid)/fanpages
fb://profile/(fbid)/fans
fb://profile/(fbid)/favorite
fb://profile/(fbid)/friends
fb://profile/(fbid)/info
fb://profile/(fbid)/menu
fb://profile/(fbid)/mutualfriends
fb://profile/(fbid)/photos
fb://profile/(fbid)/poke
fb://profile/(fbid)/removefriend
fb://profile/(fbid)/wall
fb://profile/(initWithFBID:)/menu
fb://profile/(initWithFansUID:)/fans
fb://profile/(initWithFriendsUID:)/friends
fb://profile/(initWithInfoUID:)/info
fb://profile/(initWithMutualFriendsUID:)/mutualfriends
fb://profile/(initWithPhotosUID:)/photos
fb://profile/(initWithUID:)
fb://profile/(initWithUID:)/addfriend
fb://profile/(initWithUID:)/fanpages
fb://profile/(initWithUID:)/poke
fb://profile/(initWithUID:)/removefriend
fb://profile/(initWithWallUID:)/wall
fb://profile/(toggleFavorite:)/favorite
fb://profile/(user.fbid)/fans
fb://profile/(user.fbid)/friends
fb://profile/(user.fbid)/mutualfriends
fb://profile/0
fb://publish
fb://publish/mailbox/(initWithFolder:)/(tid:)
fb://publish/mailbox/(mailbox.folder)/(tid)
fb://publish/photo/(album.user.fbid)/(album.aid)/(pid)
fb://publish/photo/(initWithUID:)/(aid:)/(pid:)
fb://publish/post/(initWithPostId:)
fb://publish/post/(postId)
fb://publish/profile/(fbid)
fb://publish/profile/(initWithUID:)
fb://publish/profile/(owner.fbid)
fb://requests
fb://root
fb://upload
fb://upload/%@/album/%lld/%@
fb://upload/%@/checkin/%lld
fb://upload/%@/profile/%lld
fb://upload/(initWithSource:)/album/(uid:)/(aid:)
fb://upload/(initWithSource:)/checkin/(checkinId:)
fb://upload/(initWithSource:)/profile/(uid:)
fb://upload/actions
fb://upload/actions/album/(initWithUID:)/(aid:)
fb://upload/actions/album/(user.fbid)/(aid)
fb://upload/actions/checkin/(checkinId)/
fb://upload/actions/checkin/(initWithCheckinId:)
fb://upload/actions/newalbum
fb://upload/actions/profile/(fbid)
fb://upload/actions/profile/(initWithUID:)
fb://upload/actions/resume
fb://upload/album/(showUploadMenuWithUID:)/(aid:)
fb://upload/album/(user.fbid)/(aid)
fb://upload/checkin/(checkinId)
fb://upload/checkin/(showUploadMenuWithCheckinID:)
fb://upload/discard
fb://upload/profile/(fbid)
fb://upload/profile/(owner.fbid)
fb://upload/profile/(showUploadMenuWithUID:)
fb://upload/resume
fb://userset
fb://video/%@
fb://video/(playVideoWithId:)
fb://video/(videoId)

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

Can a url link be shared from iOS app via FB Messenger without presenting UIActivityViewController dialog and not needing Facebook SDK?

After lots of searching I can confirm that it is not possible to share text or other media via Facebook Messenger without using their FB SDK as they do not provide URL schemes for that.



Related Topics



Leave a reply



Submit