2016-08-02 74 views
0

我試圖使用Parse.com的PFFVideosUtilsV4與Facebook登錄。我使用他們的標準:使用Parse嘗試使用Facebook登錄時獲取錯誤307 PFFVideosUtils

PFFacebookUtils.logInInBackgroundWithReadPermissions(["public_profile"]) 

{(用戶,誤差)

當我連接我的FB賬號,我的iPhone在我的iPhone的設置。每次出現代碼爲307的錯誤(如下所示)。如果我從我的iPhone設置中刪除FB/iPhone帳戶連接,錯誤消失並且發生標準驗證。我正在測試我的手機。我的手機上有FB應用程序,但這似乎不會影響錯誤。只需通過我的iPhone設置連接即可。

enter image description here

+0

下面的部分,你可以分享你有什麼做的,你採取什麼樣的措施的更多信息。 – Singh

+0

@Singh爲你增加了更多信息。謝謝! – Eric

+0

您正在使用什麼版本的Parse,PFFVideosUtils和FBSDK?他們都是最新的?我似乎記得他們放棄了本地登錄,而是強制每個人都使用Safari Web視圖進行登錄。你是否強迫它試圖使用哪種登錄方法? –

回答

0

萬一有人已經與解析與Facebook登錄任何其他錯誤這裏是我學到

加入這個關鍵是你的解析服務器的儀表板FACEBOOK_APP_ID(近在其中添加MASTER_KEY)

你必須從以下方法

[PFFacebookUtils logInWithPermissions:permissionsArray block:^(PFUser *user, NSError *error) { 

先執行切換顯示標準的Facebook獲得令牌

FBSDKLoginManager *login = [[FBSDKLoginManager alloc] init]; 
[login logInWithReadPermissions: @[@"public_profile"] 
      fromViewController:self 
         handler:^(FBSDKLoginManagerLoginResult *result, NSError *error) { 
    if (error) {  
     NSLog(@"Process error");  
    } else if (result.isCancelled) {  
     NSLog(@"Cancelled");  
    } else { 
     NSLog(@"Logged in"); 

     NSString *facebookUserId = [FBSDKAccessToken currentAccessToken].userID; 
     NSString *accessToken  = [FBSDKAccessToken currentAccessToken].tokenString; 
     NSDate *expirationDate  = [FBSDKAccessToken currentAccessToken].expirationDate; 

     [self loginFacebookUserWithTokenInfo:facebookUserId 
            accessToken:accessToken 
           expirationDate:expirationDate]; 
    } 
}]; 

然後你登錄使用的代碼

[PFFacebookUtils logInWithFacebookId:facebookId 
         accessToken:accessToken 
         expirationDate:expirationDate 
           block:^(PFUser *user, NSError *error) { 

             if (error) {    
              NSLog(@"Error!"); 
             } else { 
              NSLog(@"User logged in through Facebook and parse!"); 
              // do as you please 
             } 
            }]; 
相關問題