Skip to content

Instantly share code, notes, and snippets.

@fredriccliver
Created February 23, 2021 06:40
Show Gist options
  • Save fredriccliver/c7e1a9daddad030483e605bea25867ee to your computer and use it in GitHub Desktop.
Save fredriccliver/c7e1a9daddad030483e605bea25867ee to your computer and use it in GitHub Desktop.
let functions = Functions.functions()
functions.useFunctionsEmulator(origin: "http://localhost:5001")
functions.httpsCallable("generateSound").call() { (result, error) in
if let error = error as NSError? {
if error.domain == FunctionsErrorDomain {
let code = FunctionsErrorCode(rawValue: error.code)
let message = error.localizedDescription
let details = error.userInfo[FunctionsErrorDetailsKey]
print(code ?? "", message , details ?? "")
}
print(error.localizedDescription)
return
}
print(result)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment