'How to add Firebase Functions v8 to a Swift iOS project and use Codable in httpsCallable?
I have a Swift 5.5 iOS project that already contains Firebase 7.x and uses Firebase Functions. I just upgraded to 8.13.0, because I want to use Codable
support in Firebase Functions.
I added Firebase through the Swift Package manager and included Firebase Functions in my source code using:
import FirebaseFunctions
However, when I want to call:
func httpsCallable<Request: Encodable,
Response: Decodable>(_ name: String,
requestAs: Request.Type = Request.self,
responseAs: Response.Type = Response.self)
I get an error saying that it doesn't find this method.
Upon inspecting the packages, I discovered that the function I want to call is defined in FirebaseFunctionsSwift
in a file called Callable+Codable
.
This exists in my project as you can see:
However when I add import FirebaseFunctionsSwift
to my source file I get the following error:
No such module 'FirebaseFunctionsSwift'
How can I solve this problem?
Solution 1:[1]
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Paul Beusterien |