facebook-sdk-4.0

iOS facebookSDK get user full details

风流意气都作罢 提交于 2019-11-29 11:22:09
问题 Iam using the last FBSDK (using swift) // MARK: sign in with facebook func signInWithFacebook() { if (FBSDKAccessToken.currentAccessToken() != nil) { // User is already logged in, do work such as go to next view controller. println("already logged in ") self.returnUserData() return } var faceBookLoginManger = FBSDKLoginManager() faceBookLoginManger.logInWithReadPermissions(["public_profile", "email", "user_friends"], handler: { (result, error)-> Void in //result is

iOS 9 Facebook SDK Login/Share

谁说我不能喝 提交于 2019-11-29 08:54:10
问题 I have run into an issue using the latest Facebook SDK (4.6) on iOS 9. To authorize a user, I use the FBSDKLoginManager. I have tried setting this: loginManager.loginBehavior = FBSDKLoginBehaviorNative; But the SDK still seems to always use an SFSafariViewController to authorize Facebook. Here is the problem I am facing. If a user has the FB app installed on their device with FacebookAccountA, then tries to authenticate with my app, they are presented this SFSafariViewController and they can

Facebook AccessToken.getAccessToken is null on opening of app even after first login

空扰寡人 提交于 2019-11-29 06:20:13
I have integrated latest Facebook android sdk (Sdk 4.0). This is the code I have added in my onCreate method. FacebookSdk.sdkInitialize(this.getApplicationContext()); callbackManager = CallbackManager.Factory.create(); if(AccessToken.getCurrentAccessToken()!=null){ Log.d(FBTAG,"facebook already logged in"); isFBLogin = true; } LoginManager.getInstance().registerCallback(callbackManager, new FacebookCallback<LoginResult>() { @Override public void onSuccess(LoginResult loginResult) { // App code Log.d(FBTAG,"facebook log in"); isFBLogin = true; } @Override public void onCancel() { // App code

Parse invalid session token (Code: 209, Version: 1.7.1)

China☆狼群 提交于 2019-11-29 02:17:43
问题 I have just update both my Parse and Facebook SDK's (1.7.1 and 4.0 respectively) - both were an absolute pain to get working I might add! However I now getting 209 errors when I try to log in with Facebook. Here's an example of my code: - (void)loginWithFacebook:(HMSuccessBlock)completion{ NSArray *permissionsArray = @[@"user_about_me",@"user_location",@"user_friends",@"user_relationships"]; // Login PFUser using Facebook [PFFacebookUtils logInInBackgroundWithReadPermissions:permissionsArray

Logout from Facebook programmatically iOS

允我心安 提交于 2019-11-29 02:15:38
问题 I am trying to logout from Facebook programmatically without using FBSDKLoginButton i had search how could I do i found this answer Can we logout facebook programatically but the problem is the FBSession is deprecated in new iOS FBSDK version my question is Is there any way to clear the fb session in the new iOS FBSDK version? if there any way to logout from Facebook programmatically? or how could I call the logout action from FBSDKLoginButton Thanking in advance :) 回答1: You have two methods

Facebook SDK 4.0 AppInviteDialog with callback

ⅰ亾dé卋堺 提交于 2019-11-29 01:46:25
In the new Fb SDK 4.0 for Android you can register a callback for the LoginButton according to the docs. https://developers.facebook.com/docs/facebook-login/android/v2.3 The question is is this possible for the AppInviteDialog as well? Or is there any other way to identify if the App-Invite was successful or not? Karim Varela Yes, this is possible. public static void openDialogInvite(final Activity activity) { String appLinkUrl, previewImageUrl; appLinkUrl = "your app link url"; previewImageUrl = "https://www.example.com/my_invite_image.jpg"; if (AppInviteDialog.canShow()) { AppInviteContent

FBSDKAppInviteDialog in Facebook iOS SDK version 4.0.1 invite successfully sent, but no notifications received

不问归期 提交于 2019-11-28 23:59:30
With the new Facebook SDK 4.0.1, I have implemented below in my "Invite to App" button: FBSDKAppInviteContent *content =[[FBSDKAppInviteContent alloc] initWithAppLinkURL:[NSURL URLWithString:@"https://fb.me/1111111111"]]; content.previewImageURL = [NSURL URLWithString:@"http://someImage.jpg"]; [FBSDKAppInviteDialog showWithContent:content delegate:self]; By clicking the button, it successfully direct me to my Facebook app, I could pick my friends and type invite message, and the invites are sent (with a success tick at the end of the progress bar). When I check appInviteDialog:

Reset Facebook Token Reference - Facebook SDK 4.0

强颜欢笑 提交于 2019-11-28 23:26:17
I previously used the following to clear and reset the Facebook access token [FBSession.activeSession closeAndClearTokenInformation]; Since the update to 4.0 this no longer works. FBSession.activeSession has changed to [FBSDKAccessToken currentAccessToken] . I however can't find the latest version of closeAndClearTokenInformation that works with the latest version. Any suggestions? FBSDKLoginManager *logMeOut = [[FBSDKLoginManager alloc] init]; [logMeOut logOut]; or [FBSDKAccessToken setCurrentAccessToken:nil]; [FBSDKProfile setCurrentProfile:nil]; to logout Then when you login again, make

How to get the logged user's email address with Graph Request in Facebook Android sdk 4.0

耗尽温柔 提交于 2019-11-28 20:43:26
I'm trying to get the user's email address once he's logged into my Android app with Facebook (sdk 4.0). I've read many posts asking the same thing but I still couldn't make it work. I simply log the user in with the code LoginManager.getInstance().logInWithReadPermissions(this, Arrays.asList("public_profile", "user_friends", "email")); Then I make the Graph API request with LoginManager.getInstance().registerCallback(fbCallbackManager, new FacebookCallback<LoginResult>() { @Override public void onSuccess(LoginResult loginResult) { System.out.println(loginResult.getAccessToken().toString());

Facebook SDK 4.0.1 Login without login button

余生长醉 提交于 2019-11-28 17:36:35
I'm trying to log in without using login button. I followed facebook tutorial but i can not get it work, always give me NullPointerException. My Manifest: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.hema.testfcaebooksdk" > <uses-permission android:name="android.permission.INTERNET"/> <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" > <meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/facebook