firebase-ios-sdk icon indicating copy to clipboard operation
firebase-ios-sdk copied to clipboard

FirebaseAnalytics: sessionID class func has incorrect documentation

Open SwiftNativeDeveloper opened this issue 1 year ago • 1 comments

Description

The documentation provided for sessionID shows the objective-c closure based design, but the function signature is the swift async throws variant. The documentation should either show both the closure and the async throws variant or show one.

Either case, the method signature should match the documentation and vice versa.

https://firebase.google.com/docs/reference/swift/firebaseanalytics/api/reference/Classes/Analytics#/c:objc(cs)FIRAnalytics(cm)sessionIDWithCompletion:

Reproducing the issue

Look at the documentation

https://firebase.google.com/docs/reference/swift/firebaseanalytics/api/reference/Classes/Analytics#/c:objc(cs)FIRAnalytics(cm)sessionIDWithCompletion:

        // Documentation has this signature for the comments
        Analytics.sessionID(completion: <#T##(Int64, (any Error)?) -> Void#>)

        Task {
            // The method signature in the documentation uses async await and throws
            let sessionID = try await Analytics.sessionID()
        }

Firebase SDK Version

10.23.1

Xcode Version

15.3

Installation Method

Swift Package Manager

Firebase Product(s)

Analytics

Targeted Platforms

iOS

Relevant Log Output

No response

If using Swift Package Manager, the project's Package.resolved

n/a

If using CocoaPods, the project's Podfile.lock

n/a

SwiftNativeDeveloper avatar Apr 04 '24 14:04 SwiftNativeDeveloper

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

google-oss-bot avatar Apr 04 '24 14:04 google-oss-bot