Reputation: 548
I have used Facebook share everywhere and it works like a charm but suddenly in one fragment the share dialog though generated and I can see the Id while debugging and though it enters the function and doesn't throw any error cannot be seen.
myHolder.facebookShare.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
shareOnFacebook(position,activity);
}
});
private void shareOnFacebook(int position,Activity activity)
{
ShareDialog shareDialog = new ShareDialog(activity);
String url = "www.prabhukonchada.com";
String supportMessage="Read More and get latest updates of your favourite superstar on the app";
String redirectLink = "https://play.google.com/store/apps?hl=en";
String title = questionModelStoreList.get(position-1).getName();
String postMessage = questionModelStoreList.get(position-1).getQuestionAsked();
if(postMessage.length()>65)
{
postMessage = postMessage.substring(0,65);
}
otherRequiredServices.shareOnFacebook(postMessage.concat("...."),supportMessage,shareDialog,url,title,redirectLink);
}
// otherRequiredServices.shareOnFacebook is the method below
public static void shareOnFacebook(String shareText,String supportingMessage,ShareDialog shareDialog,String url,String title,String redirectLink)
{
if (ShareDialog.canShow(ShareLinkContent.class)) {
ShareLinkContent linkContent = new ShareLinkContent.Builder()
.setContentTitle(title+"\" " + shareText +"\"")
.setContentDescription(supportingMessage)
.setContentUrl(Uri.parse(redirectLink)).setImageUrl(Uri.parse(url))
.build();
shareDialog.show(linkContent);
Upvotes: 0
Views: 789
Reputation: 548
I never thought this would be the culprit !!! The problem is with the url.The url should be something like "https://play.google.com/store/apps?hl=en" and not "www.helloworld.com" which is stopping the Facebook dialog to pop up.
Upvotes: 1