facebook-android-sdk

LoginButton with native Fragment

孤者浪人 提交于 2019-12-01 15:53:40
I'm trying to implement the Facebook LoginButton using the tutorial here https://developers.facebook.com/docs/android/login-with-facebook/v2.0#step2 The problem is on the line authButton.setFragment(this); . I'm using native fragments (android.app.Fragment) but setFragment expects a support Fragment (android.support.v4.app.Fragment). EDIT: I cannot switch to support Fragments, I have a big app that uses native Fragments. I think the solution you are looking for is the wrapper class below. Using this you can just call authButton.setFragment(new NativeFragmentWrapper(this)); The wrapper is a

LoginButton with native Fragment

只谈情不闲聊 提交于 2019-12-01 14:43:53
问题 I'm trying to implement the Facebook LoginButton using the tutorial here https://developers.facebook.com/docs/android/login-with-facebook/v2.0#step2 The problem is on the line authButton.setFragment(this); . I'm using native fragments (android.app.Fragment) but setFragment expects a support Fragment (android.support.v4.app.Fragment). EDIT: I cannot switch to support Fragments, I have a big app that uses native Fragments. 回答1: I think the solution you are looking for is the wrapper class below

Upload comments to particular post of facebook with object_id android

跟風遠走 提交于 2019-12-01 13:47:33
问题 Hello friends I want to post comment to particular post in facebook with my android app, below is my code- I Fetch All comments from URL which is below http://retirementhomeslisting.com/home-detail/canterbury-place-83 Bundle mBundle=new Bundle(); mBundle.putString("message","testing...1234555"); @SuppressWarnings("deprecation") Facebook fb=new Facebook(getResources().getString(R.string.fb_app_id)); try { fb.request("478409145610921/comments",mBundle,"POST"); } catch (FileNotFoundException e)

Android - Facebook Integration: Impossible to Import com.facebook.Session

限于喜欢 提交于 2019-12-01 12:52:16
i'm new on android - facebook integration. I'm trying to integrate my app with facebook, so i follow all the steps on the facebook tutorial , and things work fine (at least i'm abble to perform the login). But when i try to use this following code, i realize that i can't import the library from the Facebook: Session session = Session.getActiveSession(); I'm using Android Studio, and the IDE only give me the option to import the android.service.textservice.SpellCheckerService , but i guess that the right import is com.facebook.Session Any ideas of what i'm missing here? PS: FB SDK version is

Android - Clear Facebook access token

僤鯓⒐⒋嵵緔 提交于 2019-12-01 12:08:48
I have a SettingsActivity where there are several options including finding Facebook friends and logging out. So when a user chooses to find her Facebook friends, she will be sent to another activity where I let her logging in with her Facebook account and save her access token. And then when she chooses to log out, her access token will be cleared. The problem is, my logout method is not written in the same activity with the one I created the session, so when I tried this: Session session = Session.getActiveSession(); if (!session.isClosed()) { session.closeAndClearTokenInformation(); }

Facebook android sdk how to get the number of likes for a given page

烂漫一生 提交于 2019-12-01 09:26:02
I would like to get the number of likes for a given page with its id. Here is the graph api request I would like to translate with the facebook-android-sdk. I cannot figure how to make it. I get errors if I try : Bundle params = new Bundle(); params.putString("fields", "likes"); Request request = new Request(session,"104249301622", params, HttpMethod.GET, new Request.Callback() { @Override public void onCompleted(Response response) { JSONObject res = response.getGraphObject().getInnerJSONObject(); System.out.println(res); } }); Here is the method to call : Session session = Session

Android ClassNotFound and android.view.InflateException:

早过忘川 提交于 2019-12-01 08:54:28
I m trying to integrate the facebook in my app.I am using facebook example app downloaded from facebook as a reference(also generated the appId and all this process on developer.facebook ).I am little lazy so I do not want to go through all the code of facebook sdk.In simple words i just add the com_android_facebook library project in my app, and also copy all the classes in facebook example app in my app except Example.java Now i modify the MyActivity class look like Example.java class, means MyActivity now have all the code of Example class and also my main Activity. and i change the layout

Managing Facebook Session in Android App throughout multiple activities with Facebook SDK 3

别等时光非礼了梦想. 提交于 2019-12-01 08:37:45
I have started using Facebook SDK 3.0. I am using LoginButton widget to login into the Facebook. I am referring Scrumptious sample for doing so. In this sample, one Activity(Where session is being initialized) is hosting multiple Fragments. But in my app, multiple activities hosting multiple fragments. First the launcher activity(Where session is being initialized) does the login operation with the LoginButton widget. How can i handle the session when I moved to other activities??? I found same kind of questions in StackOverFlow, but it has been answered for deprecated Facebook object . But i

Android Facebook SDK FacebookDialog.shareDialogBuilder doesn't show my description

ⅰ亾dé卋堺 提交于 2019-12-01 08:17:47
I'm using the Facebook Android SDK to post a share from my Android app, setting the link to the Google Play url but I want to fill in my own description to be displayed. My description shows up in my preview when I'm posting from my app, but when it gets displayed all that shows is "GET IT ON GOOGLE PLAY" and my description has disappeared. I am modifying code taken from the Facebook share tutorial included in the SDK (currently using version 3.19.0), here is the ShareDialogBuilder code: private FacebookDialog.ShareDialogBuilder createShareDialogBuilderForLink() { return new FacebookDialog

Facebook android sdk how to get the number of likes for a given page

雨燕双飞 提交于 2019-12-01 07:45:59
问题 I would like to get the number of likes for a given page with its id. Here is the graph api request I would like to translate with the facebook-android-sdk. I cannot figure how to make it. I get errors if I try : Bundle params = new Bundle(); params.putString("fields", "likes"); Request request = new Request(session,"104249301622", params, HttpMethod.GET, new Request.Callback() { @Override public void onCompleted(Response response) { JSONObject res = response.getGraphObject()