Share text via Intent on Facebook without using Fa

2019-01-14 06:03发布

As Facebook doesn't allow sharing text via Intent unless we use Facebook sdk, I am looking for a way around to achieve this.

I can think of 3 hacks which I can use:

1) As Facebook allows image sharing, I can generate a Bitmap with sharing text drawn onto it and share the image using Intent.

2) Facebook allows sharing URLs, for which it also displays the Head of the page while sharing. I can host a dedicated page on my server and pass values as parameter in the url, and generate the Head using it.(I have no experience with php, but I guess this is possible)

3) Copy text to clipboard and notify user about this.

OR

Use combinations of all 3.

Can anyone suggest me a much better way around to share my content on Facebook without using Facebook sdk?

Thanks in advance.

7条回答
可以哭但决不认输i
2楼-- · 2019-01-14 06:48

If you don't mind other sharing options being presented you can just use a regular sharing intent with a picker since Facebook will be one of the options to share if they have it enabled.

Intent shareIntent = new Intent();
shareIntent.setAction(Intent.ACTION_SEND);
shareIntent.putExtra(Intent.EXTRA_TEXT, "This is my text to send.");
shareIntent.setType("text/plain");
startActivity(Intent.createChooser(shareIntent, "Choose sharing method"));
查看更多
登录 后发表回答