2016-09-19 6 views
1
let digits = Digits.sharedInstance() 
    let configuration = DGTAuthenticationConfiguration(accountFields: .DefaultOptionMask) 
    configuration.appearance = DGTAppearance() 
    //configuration.appearance.backgroundColor = UIColor.whiteColor() 
    //configuration.appearance.accentColor = UIColor.init(hex: "3D3B50") 
    configuration.appearance.accentColor = UIColor(red:0.33, green:0.67, blue:0.93, alpha:1.0) 
    configuration.phoneNumber = "+65" 


    digits.authenticateWithViewController(nil, configuration: configuration) { session, error in 
     if (session != nil) { 
      print(session!.phoneNumber) 

     } else { 
      NSLog("Authentication error: %@", error!.localizedDescription) 
     } 
    } 

"모양"수정을 시도하거나하지 않고 시도한 경우 첫 번째 클릭시 요청 보내기 버튼은 항상 표시되지 않습니다. 그러나 일단 내가 취소하고 다시보기를 시작 - 그 모든 좋은.첫 번째 트리거에서 Digits API의 "확인 코드 전송"버튼은 항상 보이지 않습니다.

또한 주 스레드에서 명시 적으로 호출을 시도했습니다.

다른 사람이 같은 문제가 있습니까?

먼저 트리거 : enter image description here

두 번째 트리거 : 당신이 전무 뷰 컨트롤러를 인증하기 때문에 enter image description here

답변

2

내가 생각. 이걸 사용해보십시오

let digits = Digits.sharedInstance() 
     let configuration = DGTAuthenticationConfiguration(accountFields: .DefaultOptionMask) 
     configuration.appearance = DGTAppearance() 
     configuration.appearance.accentColor = UIColor(red: 0.0/255.0, green: 170.0/255.0, blue: 255.0/255.0, alpha: 1.0) 
     configuration.appearance.headerFont = UIFont(name: "Avenir-Light", size: 18) 
     configuration.appearance.labelFont = UIFont(name: "Avenir-Light", size: 16) 
     configuration.appearance.bodyFont = UIFont(name: "Avenir-Light", size: 16) 
     digits.authenticateWithViewController(self, configuration:configuration) { session, error in 
      if session != nil { 
       print(session!.phoneNumber) 
      } else { 
        NSLog("Authentication error: %@", error!.localizedDescription) 
      } 
     }