2016-09-19 10 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

第2のトリガ: enter image description here

答えて

2

あなたがnilビューコントローラで認証するので、私は、と思います。試してみてください

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) 
      } 
     } 
関連する問題