Compose a Message with predefined link attached from iOS app into Facebook Messenger
Asked Answered
B

2

1

I am using fb-messenger://compose to open Facebook Messenger Composer, but I need to attach a predefined link into the composer. I don't want to use action sheet for that. I also saw this answer -

Facebook Messenger Compose Predefined Message

Which may seem similar but is a wrong answer because it is Facebook SDK and not Facebook Messenger.

I looked at Facebook Messenger SDK for iOS -

https://developers.facebook.com/docs/messenger/ios

under Basic Integration \ Sharing Content

and all I could find is sharing images, animated gifs, videos, and audio clips. But on the other hand I saw that Pinterest are posting link to Messenger from their iOS app - so it is possible.

Any help will be appreciated

Update: I managed to open messenger on the compose message using:

fb://messaging/new

still cant open it with my link attached

Babettebabeuf answered 18/4, 2016 at 8:35 Comment(5)
prefilling the message is not allowed according to the platform policy.Attribute
so I have to use facebook sdk to do that?Babettebabeuf
again, prefilling the message is not allowed. with or without any sdk or api.Attribute
actually it is enough for me to open the message composer with a link attached to a message (without prefiling) is that possible?Babettebabeuf
@Babettebabeuf , het if you havn't found your answer yet, I think you are looking for FBSDKShareKit , see here : #27065302Speculative
S
0

I'm thinking it's only possible from the iOS/Android SDK's. I have done a lot of digging including going thru their iOS SDK to see if I could grab the share url. This is what that link looks like when sent from iOS to messenger.

This link will actually work to open your Messenger (but the image will be blank if you don't have anything in the messenger Pasteboard

fb-messenger-platform-20150714://broadcast?pasteboard_type=com.messenger.image&app_id=XXXAPPIDXXX&version=20150714

Notice the iOS SDK saved the image com.messenger.image. Basically they store the image in a Pasteboard. You can read about that here https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIPasteboard_Class/)

If anyone has any insight or hidden API's please let me know. Trying to post videos and animated gifs and nothing so far has worked.

This is the only way the iOS SDK sends, I'm still digging thru all the code comments to see if I can find some insight into other params that may or may not be available.

Sorry for the more than likely bad news unless you are building an iOS APP then it's simple.

Sly answered 2/5, 2016 at 8:51 Comment(1)
There may be a way in Android to do it, I'm just not versed in Java much. Looks like the url being built there my actually work once all the params are filed out which would give you a link that would work elsewhere. android.resource://com.facebook.samples.messenger.send/ github.com/facebook/facebook-android-sdk/blob/master/samples/…Sly
C
-2

Please remove facebook app form your device then check, it will work.

Conveyancer answered 18/4, 2016 at 8:58 Comment(1)
not working.. i tried "fb-messenger://compose?text=hello"Babettebabeuf

© 2022 - 2024 — McMap. All rights reserved.