Skip to content

Commit

Permalink
Format swift code
Browse files Browse the repository at this point in the history
  • Loading branch information
CSantosM committed Mar 22, 2020
1 parent 86bdf69 commit 1f2f1ff
Showing 1 changed file with 39 additions and 39 deletions.
78 changes: 39 additions & 39 deletions src/ios/VeriffCordovaPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Veriff
@objc(TwilioVideoCordovaPlugin) class VeriffCordovaPlugin: CDVPlugin {

var callbackId: String = ""

@objc(launchVeriffSDK:)
func launchVeriffSDK(command: CDVInvokedUrlCommand) {
callbackId = command.callbackId! as String
Expand Down Expand Up @@ -41,45 +41,45 @@ extension VeriffCordovaPlugin : VeriffDelegate {

func onSession(result: VeriffResult, sessionToken: String) {
var text = "VeriffSDK Result: "
switch result.code {
case .STATUS_DONE:
// Session is completed from clients perspective.
text += "Session is completed from clients perspective"
break
case .STATUS_ERROR_SESSION:
// Invalid sessionToken is passed to the Veriff SDK.
text += "Invalid sessionToken is passed to the Veriff SDK"
break
case .UNABLE_TO_ACCESS_CAMERA:
// Failed to access device's camera. (either access denied or there are no usable cameras)
text += "Failed to access device's camera"
break
case .STATUS_USER_CANCELED:
// User cancelled the session.
text += "User cancelled the session";
break
case .STATUS_SUBMITTED:
// Photos are successfully uploaded.
text += "Photos are successfully uploaded"
break
case .STATUS_ERROR_NETWORK:
// Network is unavailable.
text += "Network is unavailable"
break
case .STATUS_ERROR_NO_IDENTIFICATION_METHODS_AVAILABLE:
// No identifications methods available
text += "No identifications methods available"
break
case .STATUS_ERROR_UNKNOWN:
// Unknown error occurred.
text += "Unknown error occurred"
break
case .UNABLE_TO_ACCESS_MICROPHONE:
// Failed to access device's microphone.
text += "Failed to access device's microphone"
break
switch result.code {
case .STATUS_DONE:
// Session is completed from clients perspective.
text += "Session is completed from clients perspective"
break
case .STATUS_ERROR_SESSION:
// Invalid sessionToken is passed to the Veriff SDK.
text += "Invalid sessionToken is passed to the Veriff SDK"
break
case .UNABLE_TO_ACCESS_CAMERA:
// Failed to access device's camera. (either access denied or there are no usable cameras)
text += "Failed to access device's camera"
break
case .STATUS_USER_CANCELED:
// User cancelled the session.
text += "User cancelled the session";
break
case .STATUS_SUBMITTED:
// Photos are successfully uploaded.
text += "Photos are successfully uploaded"
break
case .STATUS_ERROR_NETWORK:
// Network is unavailable.
text += "Network is unavailable"
break
case .STATUS_ERROR_NO_IDENTIFICATION_METHODS_AVAILABLE:
// No identifications methods available
text += "No identifications methods available"
break
case .STATUS_ERROR_UNKNOWN:
// Unknown error occurred.
text += "Unknown error occurred"
break
case .UNABLE_TO_ACCESS_MICROPHONE:
// Failed to access device's microphone.
text += "Failed to access device's microphone"
break
}

self.returnSuccessToCordova(message: text)
}
}
}

0 comments on commit 1f2f1ff

Please sign in to comment.