Closed landry314 closed 4 years ago
Facebook includes a bunch of arguably invasive and pointless tracking information (for the clicker, not so much the sharer) in that link query string, but MFB can't mess with it a lot because
Facebook breaking things silently all the time
un-parsing that link and making a Dictionary out of the query string keys and sifting them for the important ones and then re-generating the link string is a lot of memory and slowdown for such a simple and rewardless operation
Probably a better way of doing this but...
if(webView.getUrl() != null && webView.getUrl().contains("/events/")) { try { Intent sharingIntent = new Intent(Intent.ACTION_SEND); sharingIntent.setType("text/plain"); sharingIntent.putExtra(Intent.EXTRA_TEXT, webView.getUrl().substring(0, webView.getUrl().indexOf("?")).replace("m.facebook.com", "www.facebook.com")); startActivity(Intent.createChooser(sharingIntent, getResources().getString(R.string.share_action))); Log.i("New event link", webView.getUrl().substring(0, webView.getUrl().indexOf("?")).replace("m.facebook.com", "www.facebook.com")); }catch (StringIndexOutOfBoundsException i){ i.printStackTrace(); Intent sharingIntent = new Intent(Intent.ACTION_SEND); sharingIntent.setType("text/plain"); sharingIntent.putExtra(Intent.EXTRA_TEXT, webView.getUrl()); startActivity(Intent.createChooser(sharingIntent, getResources().getString(R.string.share_action))); Log.e("Couldn't truncate link", webView.getUrl()); } }else{ Intent sharingIntent = new Intent(Intent.ACTION_SEND); sharingIntent.setType("text/plain"); sharingIntent.putExtra(Intent.EXTRA_TEXT, webView.getUrl()); startActivity(Intent.createChooser(sharingIntent, getResources().getString(R.string.share_action))); }
When I share an event link using the "Share Link" function in the floating button, it creates a really long link that is very ugly. I always find myself trimming it down to before the "?acontext=" in the link; i manually delete the query by deleting the '?' character and everything after it before sharing the link.
I would be so happy if MaterialFBook would do this for me. All the information in the query is totally unnecesary for sharing the link and it makes it look ugly... This might also be a privacy issue, I don't know what it all means but it could be revealing something about me.
Can the query be deleted before the link is shared? Does anyone agree this is a good idea?
If there is any argument, maybe a setting could be created, "make links ugly and have too much unnecesary info" hahaha.