Share a text with facebook messenger?

后端 未结 4 1418
囚心锁ツ
囚心锁ツ 2020-12-10 11:05

Is there a way to share a text in facebook messenger using android and maybe facebook sdk as well?

I want to make something like the whatsapp way, choose your text a

4条回答
  •  伪装坚强ぢ
    2020-12-10 11:54

    only link/video/picture

    https://developers.facebook.com/docs/sharing/android/

    And here's the bad news: https://developers.facebook.com/docs/messenger-platform/changelog/?locale=en_US#20190610

    June 10, 2019

    Messenger Platform Announcement

    Won't function with the new app

    Share to Messenger SDK that allows people to share links and media from apps to Messenger will no longer be supported. Businesses and developers might need to make modifications to their app to trigger native OS sharing. People will be able to share content to Messenger using the native sharing features that is built into their devices.

    but in my test on Android,I can still share the link/pic/video to Messenger using the latest Facebook SDK

    import com.facebook.share.model.ShareLinkContent;
    import com.facebook.share.widget.MessageDialog;
    
    
    ShareLinkContent content = new ShareLinkContent.Builder()
                            .setContentUrl(Uri.parse("https://xxx.xxx/xxx"))
                            .build();
    //no callback
    MessageDialog.show(context, content);
    

提交回复
热议问题