Facebook shareDialog shows nothing

I am trying to share some content on facebook, but I have a lot of problems. I add the correct keyhash, and created the application on facebook and put it live. When I try to share something, it seems good, as you can see:

enter image description here

But after I clicked on the message, it is empty: enter image description here

Is this a resolution problem? I read a lot about this on the stack, but I cannot find an answer that works ... What is the code:

public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case R.id.action_share: Intent intent2=new Intent(Intent.ACTION_SEND); intent2.setType("text/plain"); intent2.putExtra(Intent.EXTRA_TEXT,"'"+ random + "'" + "\n"+"By Random Quotes"); startActivity(Intent.createChooser(intent2, "Share via")); break; case R.id.randombut: Frasi(); case android.R.id.home: Intent homeIntent = new Intent(this, MainActivity.class); homeIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); startActivity(homeIntent); break; case R.id.facebook: FacebookDialog shareDialog = new FacebookDialog.ShareDialogBuilder(this) .setApplicationName("Random Quotes") .setDescription(random) .setPicture("https://lh6.ggpht.com/1UJ89ho9pvVLPYS6NsFVQdb7KoQPALMhkw1w7DnNDqcfDYJ-tRxruaf2YLMLyqhnG_g=w300-rw") .setLink("https://play.google.com/store/apps/details?id=com.techappstudios.randomquotes") .build(); uiHelper.trackPendingDialogCall(shareDialog.present()); } return true; } 
+8
android sharing
source share
3 answers

I had a similar problem.

I fixed it by changing where the photo came from (don't ask me why it worked because I really don't know).

Instead of capturing my image URL from sites like facebook or google play, I uploaded the photo to gethub. With gethub, the url image ends in .png. The picture, link and description are published as intended.

Give it a try. Hope this helps.

+1
source share

I think this is related to permission, you need to request publish_actions permission. For the first time, facebook will ask for a new permission. After you have agreed, the general dialogue will be displayed directly.

This is what I did, but the code that I replaced with your sharing information.

 final Session activteSession = Session.getActiveSession(); if(!activteSession.isPermissionGranted("publish_actions")) { Session.getActiveSession().requestNewPublishPermissions(new Session.NewPermissionsRequest(this, "publish_actions")); } FacebookDialog shareDialog = new FacebookDialog.ShareDialogBuilder(this) .setApplicationName("Random Quotes") .setDescription(random) .setPicture("https://lh6.ggpht.com/1UJ89ho9pvVLPYS6NsFVQdb7KoQPALMhkw1w7DnNDqcfDYJ-tRxruaf2YLMLyqhnG_g=w300-rw") .setLink("https://play.google.com/store/apps/details?id=com.techappstudios.randomquotes") .build(); uiHelper.trackPendingDialogCall(shareDialog.present()); mFacebookUIHelper.trackPendingDialogCall(shareDialog.present()); 

Hope this helps.

0
source share

From the latest update to the Facebook SDK, Facebook does not allow text before filling out. This way you can only share the URL right now. It doesn’t matter if you use ShareDialog or Share Intent.

See the error link below for more details.

https://developers.facebook.com/bugs/332619626816423

0
source share

All Articles