2016-08-03 2 views
0

OneDrive 문제가 있습니다.로그 아웃하는 방법 iOS OneDrive 권한 UI

이 사이트의 OneDrive Sample App을 테스트했습니다. https://github.com/OneDrive/onedrive-sdk-ios

단계 :

  1. 버튼 '로그인'을 클릭했습니다. 로그인하십시오.

  2. 에 권한 UI가 표시되었습니다. '취소'또는 '아니요'버튼을 클릭하십시오. enter image description here

  3. 다음 사용 권한 UI가 닫힙니다. '로그인'을 다시 클릭하십시오.

  4. 다음 사용 권한 UI가 다시 표시되었습니다.

다른 계정에 로그인하려면 권한 UI에서 '예'버튼을 클릭해야합니다. 로그 아웃하고 다시 로그인하십시오.

권한 UI에서 '취소'또는 '아니요'버튼을 클릭하면 로그 아웃하는 방법.

이 코드입니다 : 내가 클릭하면

[ODClient authenticatedClientWithCompletion:^(ODClient *client, NSError *error){ 
    if (!error){ 
     self.client = client; 
     [self loadChildren]; 
     dispatch_async(dispatch_get_main_queue(), ^(){ 
      self.navigationItem.rightBarButtonItem = self.actions; 
     }); 
    } 
    else{ 
     [self showErrorAlert:error]; 
    } 
}]; 

권한 UI에서 '아니오'버튼을 '취소 없습니다'또는 오류가 전무 없습니다. 클라이언트 (ODClient)는 nil입니다. 그러면 signout 메소드를 호출 할 수 있습니다. (자가. 클라이언트는 0이 아닙니다.)

답변

0

해결책을 찾았습니다.

[ODClient clientWithCompletion:^(ODClient *client, NSError *error) 
{ 
    if (error == nil) 
    { 
     self.client = client; 
    } 
    else 
    { 
     NSHTTPCookieStorage* storage = [NSHTTPCookieStorage sharedHTTPCookieStorage]; 
     for(NSHTTPCookie* cookie in [storage cookies]) 
     { 
      [storage deleteCookie:cookie]; 
     } 
    } 
}]; 
관련 문제