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

六眼飞鱼酱① 提交于 2020-01-14 05:52:07

问题


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


回答1:


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.




回答2:


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



来源:https://stackoverflow.com/questions/36689056/compose-a-message-with-predefined-link-attached-from-ios-app-into-facebook-messe

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!