facebook-android-sdk

Facebook Profile.getCurrentProfile() is always returns null after the first login

混江龙づ霸主 提交于 2019-12-08 02:44:45
问题 For the first time when I login into the app through Facebook, I'm getting profile from Profile.getCurrentProfile(); Where as when I exit the app and launch again, It was already logged in. So I can call directly Profile.getCurrentProfile(); is returning null. Code @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); FacebookSdk.sdkInitialize(getApplicationContext()); setContentView(R.layout.activity_page); Profile profile = Profile

Failed to find provider info for com.facebook.katana.provider.platformprovider and com.facebook.wakizashi.provider.platformprovider

廉价感情. 提交于 2019-12-07 12:50:04
问题 In my android app, I use FacebookDialog. I am writing down the following code. In Galaxy Note3(Android4.4.2), It goes well. However, in Experia SOL21(Android4.1.2) it doesn't. The error code is following. [My code] in Activity.java private UiLifecycleHelper uiHelper; private void FbShare(String shareTitle, String shareUrl,String shareImageUrl) { if (FacebookDialog.canPresentShareDialog(getApplicationContext(), FacebookDialog.ShareDialogFeature.SHARE_DIALOG)) { try { FacebookDialog shareDialog

FacebookCallback#onCancel() is calling after login once in Facebook Sdk 4.2.0 in Android

ⅰ亾dé卋堺 提交于 2019-12-07 10:56:04
问题 I have successfully implemented login with facebook in android app. But now, Amazingly, When I do login one with facebook and if I try to login with facebook using facebook library 4.2.0 its onCancel() method is calling. Help! 回答1: I solved this problem by calling: LoginManager.getInstance().logOut(); just before trying to login. 回答2: i have not tried the above mentioned code but the thing worked for me is i have written some code in on cancel same as in success @Override public void onCancel

Facebook android sdk 3.0 SSO

荒凉一梦 提交于 2019-12-07 05:13:19
问题 In previous versions of the Facebook SDK we could check if a user is still signed in by using tokens. In the new 3.0 version I can't find another way other than invoking openSession() to check if the user is still logged in with SSO . But openSession() automatically invokes the login if the user is not saved and I don't want that. I only want to check SSO. How do I do this? 回答1: I made a helper function that to check if the user is still logged in (or actually has an active session) for me in

Updating Session after revoking individual permissions

半腔热情 提交于 2019-12-07 02:05:14
问题 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

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

末鹿安然 提交于 2019-12-06 21:19:09
问题 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" /> 回答1: I had the same: the IDE re-inserted the curly braces. I cut the part, restarted Android Studio and pasted it. Then it worked. 回答2: The format shoud be: android:authorities="com.facebook.app.FacebookContentProvider0123456789" , where 012345678 is your Facebook app ID .

How to solve this facebook key hash error?

眉间皱痕 提交于 2019-12-06 18:06:10
问题 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. 回答1: 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

data always null in onactivityresult facebook android sdk 3.0

百般思念 提交于 2019-12-06 16:09:07
I am stuck with this error for last 8 hours after a lot of debugging I have found that data returned via Intent is null inside my onActivityResult method. This is the code that I use to login. signInWithFacebook(); method is called via button in my activity, Session mCurrentSession; SessionTracker mSessionTracker; private void signInWithFacebook() { mSessionTracker = new SessionTracker(getBaseContext(), new StatusCallback() { @Override public void call(Session session, SessionState state, Exception exception) { } }, null, false); String applicationId = Utility.getMetadataApplicationId

isSessionValid() returns NO when Facebook native application is installed

本秂侑毒 提交于 2019-12-06 16:07:15
问题 I have an issue with SSO using the Facebook SDK for Android. The problem occurs only when the native Facebook application is installed. When it's not installed, everything works fine, specifically: Facebook facebook = new Facebook(APP_ID); facebook.authorize(mActivity, , new DialogListener() { ... }); facebook.isSessionValid(); // returns true But when the native application is installed, facebook.isSessionValid() still returns false despite the fact that I called the authorize method. I

FB sdk, requestNewPublishPermissions() doesn't call any callback

萝らか妹 提交于 2019-12-06 15:59:38
I followed the FB tutorial step by step, and I can't figure out why is this not working. All my fragments inherits from the BaseFragment : public class BaseFragment extends SherlockFragment { ... protected UiLifecycleHelper _uiHelper; protected boolean _isResumed = false; protected static final List<String> PERMISSIONS = Arrays.asList("publish_actions"); protected static final String PENDING_PUBLISH_KEY = "pendingPublishReauthorization"; protected boolean _pendingPublishReauthorization = false; protected Session.StatusCallback _callback = new Session.StatusCallback() { @Override public void