Tuesday, 15 July 2014

android - Facebook SDK and sharing a Play Store app link with ShareDialog issue -


After

I am trying to share a link using ShareDialog (my Google Play app link) from Facebook SDK, but The problem is that when the URL is in my app's Google Play link, other information is not being displayed properly ... Actually it's only displaying links from Google Play without a name or description!

Here is the code:

  FacebookDialog shareDialog = New FacebookDialog.ShareDialogBuilder (this) .setLink ("https://play.google.com/store/apps/details ? Id = & lt; myapp & gt; ") .setDescription (" Test ") .SetName (" Test for Facebook ") .build (); UiHelper.trackPendingDialogCall (shareDialog.present ());  

I tried everything and actually worked with other URLs (displaying names, details, captions etc.), but not with the app's URL.

Do anyone know why Google Play will not work with text, description or captions?

Actually if you have contentUrl (in 4.0) or link (in your case), it overrides name , description , etc. You do not need to give it to other things because after this it The responsibility for url host is made when it should be posted on the Facebook timeline.

However, if you want to share something with your app link by the message from user . Then I have the suggestion to go to Graph API (I was wasting 2-3 days via ShareApi / ShareDialog in posting something like this, but only with using Graph API

Use the Code Graph API to share:
  // Fixed time to use when sharing messages on Facebook Time Line FACEBOOK_ERROR_PERMISSION = 200; Private static final string PARAM_EXPLICIT = "FB: explicitly shared"; Private static final string PARAM_GRAPH_PATH = "/ mi / feed"; Private static final string PARAM_MSG = "message"; Private static final string PARAM_LINK = "link"; // Create parameter for share final bundle params = new bundle (); Params.putBoolean (PARAM_EXPLICIT, true); Params.putString (PARAM_LINK, burdingout.app_url URL); // If the message is empty, only our link will be posted. String message = "This is a sharing message"; If (! TextUtils.isEptyy (message)) params.putString (PARAM_MSG, message); // Post a message on the timeline Send a request via Facebook's Graph API New GraphRequest (AccessToken.getCurrentAccessToken (), PARAM_GRAPH_PATH, Ultimate, HttpMethod.POST, New GraphRequest.Callback () {@Override Public Zero onCompleted (GraphResponse GraphResponse) {searchDialog.dismiss (); if (graphResponse.getError () ==} {// success in posting on timeline: Logger.toastShort (R.string.msg_share_success); Logger.debug (TAG, "success" . + GraphResponse);} else {FacebookRequestError error = graphResponse.getError (); if (Error.getErrorCode () == FACEBOOK_ERROR_PERMISSION) // Asked during the cancellation permission, msg Logger.toast There was an error while posting messages to Long (R.string.msg_share_permission); else // Logger.toastShort (R.string.msg_share_error); Logger .error (TAG, "Error:" + Error);} // button again Enable if profile and access token a again non-null if (profile. GetCurrentProfile ()! = Faucet || AccessToken.getCurrentAccessToken ()! = Null) mShareButton.setEnabled (true); }}) ExecuteAsync ();  

No comments:

Post a Comment