diff options
| author | levlam <levlam@telegram.org> | 2022-09-08 13:11:35 +0300 |
|---|---|---|
| committer | levlam <levlam@telegram.org> | 2022-09-08 13:11:35 +0300 |
| commit | ed8e11774c287a710acac6cd794368d32cbba54b (patch) | |
| tree | b63c1c53f7089ab40c34aaf1511fd4defcfa5bd5 /example/swift | |
| parent | a81d3768b42087f2267940816083819f16c13cbd (diff) | |
Update Swift example.
Diffstat (limited to 'example/swift')
| -rw-r--r-- | example/swift/src/main.swift | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/example/swift/src/main.swift b/example/swift/src/main.swift index bbee661f7..9e3513395 100644 --- a/example/swift/src/main.swift +++ b/example/swift/src/main.swift @@ -123,6 +123,17 @@ func updateAuthorizationState(authorizationState: Dictionary<String, Any>) { let phone_number = myReadLine() client.queryAsync(query:["@type":"setAuthenticationPhoneNumber", "phone_number":phone_number], f:checkAuthenticationError) + case "authorizationStateWaitEmailAddress": + print("Enter your email address: ") + let email_address = myReadLine() + client.queryAsync(query:["@type":"setAuthenticationEmailAddress", "email_address":email_address], f:checkAuthenticationError) + + case "authorizationStateWaitEmailCode": + var code: String = "" + print("Enter email code: ") + code = myReadLine() + client.queryAsync(query:["@type":"checkAuthenticationEmailCode", "code":["@type":"emailAddressAuthenticationCode", "code":code]], f:checkAuthenticationError) + case "authorizationStateWaitCode": var code: String = "" print("Enter (SMS) code: ") |
