"Send confirmation code" 数字上的按钮 API 在第一次触发时始终不可见
"Send confirmation code" button on Digits API always invisible on first trigger
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)
}
}
尝试过 "appearance" 修改和不修改,第一次单击时发送请求按钮始终不可见。但是,一旦我取消并再次触发视图 - 一切都很好。
还尝试过从主线程显式调用。
还有其他人遇到同样的问题吗?
第一个触发器:
第二次触发:
我认为,因为您使用 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)
}
}
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)
}
}
尝试过 "appearance" 修改和不修改,第一次单击时发送请求按钮始终不可见。但是,一旦我取消并再次触发视图 - 一切都很好。
还尝试过从主线程显式调用。
还有其他人遇到同样的问题吗?
第一个触发器:
第二次触发:
我认为,因为您使用 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)
}
}