facebook-android-sdk

Can not access Facebook friends via Android application

一曲冷凌霜 提交于 2019-12-05 06:25:55
I have a problem with accessing the graph API through my android application that retrieves a user's friends as JSONObject, extracts their names and displays them on the screen. It is supposed to be a simple and straightforward task but apparently it is not. When I run my application on Android Nexus I, I login to Facebook, then I am asked I click "Allow" button to grant permissions and I am redirected to a blank page. I am expect to see the name of my friends but it does not happen. Could some one assist me. public class Login extends Activity { Facebook mFacebook = new Facebook(

Updating Session after revoking individual permissions

半腔热情 提交于 2019-12-05 06:04:38
I'm trying to give users an option to set/revoke publishing permission via checkbox (Facebook SDK for Android). Code is provided below. Everything works fine except that after revoking the code responsible for checking publishing permissions fails miserably. I understand that Session has no way of knowing if user has revoked any permissions after loggin in. What is the correct way to handle this kind of situation? Do I have to query available permissions manually, or is there a way to seamlessly recreate session with basic permissions? public View onCreateView(LayoutInflater inflater,

Reduce the size of android facebook SDK

不打扰是莪最后的温柔 提交于 2019-12-05 04:58:40
问题 We are using facebook sdk to login the users to our app. But the SDK is pretty large hence it is increasing our apk size. Since we use only the login feature we do not require other modules of SDK (share, messenger etc). Is there any way we can add only the required features of SDK in the project? In case of google play services , additional maven artifacts have been added to the Google Repository that contain single domains of functionality.This means that we can include just those portions

Tag <provider> attribute authorities has invalid character '{' in AndroidManifest.xml using Facebook ShareLink

让人想犯罪 __ 提交于 2019-12-05 02:06:15
Though I delete the "{}" braces but it still occurs. <provider android:name="com.facebook.FacebookContentProvider" android:authorities="com.facebook.app.FacebookContentProvider{facebook_app_id}" android:exported="true" /> I had the same: the IDE re-inserted the curly braces. I cut the part, restarted Android Studio and pasted it. Then it worked. The format shoud be: android:authorities="com.facebook.app.FacebookContentProvider0123456789" , where 012345678 is your Facebook app ID . Use it without the { character. So your provider tag should be: <provider android:authorities="com.facebook.app

call finish() from static method

﹥>﹥吖頭↗ 提交于 2019-12-04 23:46:25
I am using the Facebook Android SDK and want to close my Activity after a user logs in and gets the user object. In practice I am storing parts of it but I want to close the activity regardless. // make request to the /me API Request.executeMeRequestAsync(session, new Request.GraphUserCallback() { // callback after Graph API response with user object @Override public void onCompleted(GraphUser user, Response response) { if (user != null) { finish(); // causes errors } } }); The IDE error message on finish() is: "Cannot make a static reference to the non-static method finish() from the type

Facebook SSO example not working - “An error ocurred. Please try again later”

浪子不回头ぞ 提交于 2019-12-04 23:29:48
问题 I'm trying to integrate facebook into my app and so have followed the tutorial at: Facebook Android but I can't get the first example (Single Sign-On) to work. When my app loads up I get the facebook dialog but it just says "An error occurred. Please try again later." with a facebook-style "Ok" button at the bottom and there is nothing in logcat: I followed the steps in the tutorial but I'm guessing there is something wrong with the APP ID or the hashkey generated by keytool. Here are the

How to solve this facebook key hash error?

别说谁变了你拦得住时间么 提交于 2019-12-04 22:10:41
In my project, I am using facebook API for login purpose. I got key hash error , when ever i try different account or different mobile device. Any body known this type issue. How to solve this. In below, i attached error screenshot. public void generateHashkey(){ try { PackageInfo info = getPackageManager().getPackageInfo(PACKAGE, PackageManager.GET_SIGNATURES); for (Signature signature : info.signatures) { MessageDigest md = MessageDigest.getInstance("SHA"); md.update(signature.toByteArray()); String s = Base64.encodeToString(md.digest(), Base64.NO_WRAP); Log.e("HASH KEY ", s); } } catch

Facebook Android SDK, graph api >3.2 and 4.0 sending app request issue

左心房为你撑大大i 提交于 2019-12-04 20:07:23
I am trying to send app request to my facebook friend after authentication by using the following code snippet. public void sendApplicationRequest(final List<String> userIdList, final String message, final String title, final int requestCode) { final Bundle parameters = new Bundle(); parameters.putString("title", title); parameters.putString("message", message); parameters.putInt("requestCode", requestCode); parameters.putString("frictionless", "1"); String to = getListOfUsersAsString(userIdList); if (to != null) { parameters.putString("to", to); } activity.runOnUiThread(new Runnable() {

share only text using facebook SDK

徘徊边缘 提交于 2019-12-04 19:32:02
I want to know if I can share only text (without any link) to a facebook wall/timeline using facebook android SDK? Because iOS social framework let me publish predefined text in a share dialog and android share intent doesn't let me modify the text to share (by code) and it seems to me that the facebook android SDK, only permits to share text if this comes with a link. So how can I directly publish a text/message to a facebook timeline? Vivek Warde I have written a step by step procedure to post only text in facebook wall ! Follow this https://stackoverflow.com/a/20730002/2715065 Using native

Facebook Android SDK request parameters: where find documentation? [closed]

馋奶兔 提交于 2019-12-04 18:49:08
Good evening. I'm developing an android application that uses Facebook SDK. I've no problem with user oauth authentication and I've no problem using the SDK to add a simple status update on the user wall. Now I'm trying to use more deeply this Facebook Android SDK and I found a really big lack about documentation. At the moment I'm using this snippet of code to add the user status: Bundle params = new Bundle(); params.putString("message", "my message"); params.putString("link", "my site url" ); params.putString("name", "my name"); params.putString("caption", "my caption" ); mAsyncRunner