gpt4 book ai didi

swift - Digits API 上的 "Send confirmation code"按钮在第一次触发时始终不可见

转载 作者:搜寻专家 更新时间:2023-11-01 07:20:10 25 4
gpt4 key购买 nike

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)
}
}

尝试修改和不修改“外观”,第一次单击时发送请求按钮始终不可见。但是,一旦我取消并再次触发 View - 一切都很好。

还尝试过从主线程显式调用。

还有其他人遇到同样的问题吗?

第一个触发器: enter image description here

第二个触发器: enter image description here

最佳答案

我认为,因为您使用 nil View Controller 进行身份验证。试试这个

  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)
}
}

关于swift - Digits API 上的 "Send confirmation code"按钮在第一次触发时始终不可见,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39564742/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com