2
我們使用swift 3.0和xcode 8.0的pod使用sinch驗證。我想打電話給initiate()
和verifyCode()
方法,但是編譯器顯示value of type SINVerification? has no member
我有進口import SinchVerification
並寫入下面的代碼: -在swift 3.0和xcode 8.0中沒有顯示sinch驗證方法
let region:String = SINDeviceRegion.currentCountryCode()
let phoneNumber:SINPhoneNumber?
do {
try phoneNumber = SINPhoneNumberUtil().parse("xxxxxxxxxx", defaultRegion: region)
let phoneNumberInE164:String = SINPhoneNumberUtil().formatNumber(phoneNumber!, format: SINPhoneNumberFormat.E164)
let verification = SINVerification.smsVerification(withApplicationKey: "965010f3-bb37-4356-82ba-fea0452377d9", phoneNumber: phoneNumberInE164) as? SINVerification
verification.initiate { (success:Bool, error:Error?) -> Void in
//handle outcome
if (success){
print("successfully requested phone verification")
} else {
print(error?.localizedDescription)
}
}
SMSVerification()方法不顯示 –
你是什麼意思? – cjensen
你正在使用什麼版本的sinch框架? – cjensen