Note that there are some explanatory texts on larger screens.

plurals
  1. POFacebook Android SDK integration
    primarykey
    data
    text
    <p>I encounter a problem when integrating Facebook SDK to android. Basically, I have successfully integrated to my phone. I followed the tutorial to add the hash key with 30 lenght of string. Then testing on my device it works fine.</p> <p>However, when I ask my friend to try my app, he reported that he could not do anything with the sharing facebook stuff. Here is what the chunk of code to do the sharing stuff:</p> <pre><code>/** * Publish Feed Dialog * @param current * @param title * @param caption * @param description * @param link * @param pictureUrl */ public static void publishFeedDialog(final Activity current, final String title, final String caption, final String description, final String link, final String pictureUrl) { // start Facebook Login Session.openActiveSession(current, true, new Session.StatusCallback() { // callback when session changes state @Override public void call(Session session, SessionState state, Exception exception) { if (session.isOpened()) { Bundle params = new Bundle(); params.putString("name", title); params.putString("caption", caption); params.putString("description", description); if (link != null) params.putString("link", link); if (pictureUrl != null) params.putString("picture", pictureUrl); WebDialog feedDialog = (new WebDialog.FeedDialogBuilder(current, Session.getActiveSession(), params)) .setOnCompleteListener(new OnCompleteListener() { @Override public void onComplete(Bundle values, FacebookException error) { if (error == null) { // When the story is posted, echo the // success // and the post Id. final String postId = values.getString("post_id"); if (postId != null) { Toast.makeText(current, "Posted", 2000).show(); } else { // User clicked the Cancel button Toast.makeText(current, "Publish cancelled", 2000).show(); } } else if (error instanceof FacebookOperationCanceledException) { // User clicked the "x" button Toast.makeText(current, "Publish cancelled", 2000).show(); } else { // Generic, ex: network error Toast.makeText(current, "Error posting story", 2000).show(); } } }).build(); feedDialog.show(); } } }); } </code></pre> <p>I only use this chunk of code to publish feed dialog. and for the facebook app settings:</p> <ol> <li>package Name -> com.ImranQureshi.HadithPro</li> <li>class Name -> com.imran.hadith.MainActivity</li> <li>Key Hashes -> t8tk8tRXcAXxnn4U0mRcCBSqHf</li> <li>Facebook Login -> enabled</li> <li>Deep Linking -> disabled</li> </ol> <p>If I dont use key hashes, I will get exception there, it says: com.facebook.http.protocol.ApiException: Key hash t8tk8tRXcAXxnn4U0mRcCBSqHf does not match any stored key hashes</p> <p>This makes sense because the hash is not there. When I put that hash key, it works in my real device, BUT not in my friend's device. Can you advice what is wrong?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload