14
14
15
15
import Foundation
16
16
17
- /**
18
- * A `HTTPSCallableResult` contains the result of calling a `HTTPSCallable`.
19
- */
17
+ /// A `HTTPSCallableResult` contains the result of calling a `HTTPSCallable`.
20
18
@objc ( FIRHTTPSCallableResult)
21
19
open class HTTPSCallableResult : NSObject {
22
- /**
23
- * The data that was returned from the Callable HTTPS trigger.
24
- *
25
- * The data is in the form of native objects. For example, if your trigger returned an
26
- * array, this object would be an `Array<Any>`. If your trigger returned a JavaScript object with
27
- * keys and values, this object would be an instance of `[String: Any]`.
28
- */
20
+ /// The data that was returned from the Callable HTTPS trigger.
21
+ ///
22
+ /// The data is in the form of native objects. For example, if your trigger returned an
23
+ /// array, this object would be an `Array<Any>`. If your trigger returned a JavaScript object with
24
+ /// keys and values, this object would be an instance of `[String: Any]`.
29
25
@objc public let data : Any
30
26
31
27
init ( data: Any ) {
@@ -54,9 +50,7 @@ open class HTTPSCallable: NSObject {
54
50
55
51
// MARK: - Public Properties
56
52
57
- /**
58
- * The timeout to use when calling the function. Defaults to 70 seconds.
59
- */
53
+ /// The timeout to use when calling the function. Defaults to 70 seconds.
60
54
@objc open var timeoutInterval : TimeInterval = 70
61
55
62
56
init ( functions: Functions , name: String , options: HTTPSCallableOptions ? = nil ) {
@@ -71,28 +65,27 @@ open class HTTPSCallable: NSObject {
71
65
endpoint = . url( url)
72
66
}
73
67
74
- /**
75
- * Executes this Callable HTTPS trigger asynchronously.
76
- *
77
- * The data passed into the trigger can be any of the following types:
78
- * - `nil` or `NSNull`
79
- * - `String`
80
- * - `NSNumber`, or any Swift numeric type bridgeable to `NSNumber`
81
- * - `[Any]`, where the contained objects are also one of these types.
82
- * - `[String: Any]` where the values are also one of these types.
83
- *
84
- * The request to the Cloud Functions backend made by this method automatically includes a
85
- * Firebase Installations ID token to identify the app instance. If a user is logged in with
86
- * Firebase Auth, an auth ID token for the user is also automatically included.
87
- *
88
- * Firebase Cloud Messaging sends data to the Firebase backend periodically to collect information
89
- * regarding the app instance. To stop this, see `Messaging.deleteData()`. It
90
- * resumes with a new FCM Token the next time you call this method.
91
- *
92
- * - Parameters:
93
- * - data: Parameters to pass to the trigger.
94
- * - completion: The block to call when the HTTPS request has completed.
95
- */
68
+ /// Executes this Callable HTTPS trigger asynchronously.
69
+ ///
70
+ /// The data passed into the trigger can be any of the following types:
71
+ /// - `nil` or `NSNull`
72
+ /// - `String`
73
+ /// - `NSNumber`, or any Swift numeric type bridgeable to `NSNumber`
74
+ /// - `[Any]`, where the contained objects are also one of these types.
75
+ /// - `[String: Any]` where the values are also one of these types.
76
+ ///
77
+ /// The request to the Cloud Functions backend made by this method automatically includes a
78
+ /// Firebase Installations ID token to identify the app instance. If a user is logged in with
79
+ /// Firebase Auth, an auth ID token for the user is also automatically included.
80
+ ///
81
+ /// Firebase Cloud Messaging sends data to the Firebase backend periodically to collect
82
+ /// information
83
+ /// regarding the app instance. To stop this, see `Messaging.deleteData()`. It
84
+ /// resumes with a new FCM Token the next time you call this method.
85
+ ///
86
+ /// - Parameters:
87
+ /// - data: Parameters to pass to the trigger.
88
+ /// - completion: The block to call when the HTTPS request has completed.
96
89
@objc ( callWithObject: completion: ) open func call( _ data: Any ? = nil ,
97
90
completion: @escaping ( HTTPSCallableResult ? ,
98
91
Error ? ) -> Void ) {
@@ -121,39 +114,38 @@ open class HTTPSCallable: NSObject {
121
114
}
122
115
}
123
116
124
- /**
125
- * Executes this Callable HTTPS trigger asynchronously. This API should only be used from Objective-C.
126
- *
127
- * The request to the Cloud Functions backend made by this method automatically includes a
128
- * Firebase Installations ID token to identify the app instance. If a user is logged in with
129
- * Firebase Auth, an auth ID token for the user is also automatically included.
130
- *
131
- * Firebase Cloud Messaging sends data to the Firebase backend periodically to collect information
132
- * regarding the app instance. To stop this, see `Messaging.deleteData()`. It
133
- * resumes with a new FCM Token the next time you call this method.
134
- *
135
- * - Parameter completion The block to call when the HTTPS request has completed.
136
- */
117
+ /// Executes this Callable HTTPS trigger asynchronously. This API should only be used from
118
+ /// Objective-C.
119
+ ///
120
+ /// The request to the Cloud Functions backend made by this method automatically includes a
121
+ /// Firebase Installations ID token to identify the app instance. If a user is logged in with
122
+ /// Firebase Auth, an auth ID token for the user is also automatically included.
123
+ ///
124
+ /// Firebase Cloud Messaging sends data to the Firebase backend periodically to collect
125
+ /// information
126
+ /// regarding the app instance. To stop this, see `Messaging.deleteData()`. It
127
+ /// resumes with a new FCM Token the next time you call this method.
128
+ ///
129
+ /// - Parameter completion: The block to call when the HTTPS request has completed.
137
130
@objc ( callWithCompletion: ) public func __call( completion: @escaping ( HTTPSCallableResult ? ,
138
131
Error ? ) -> Void ) {
139
132
call ( nil , completion: completion)
140
133
}
141
134
142
- /**
143
- * Executes this Callable HTTPS trigger asynchronously.
144
- *
145
- * The request to the Cloud Functions backend made by this method automatically includes a
146
- * FCM token to identify the app instance. If a user is logged in with Firebase
147
- * Auth, an auth ID token for the user is also automatically included.
148
- *
149
- * Firebase Cloud Messaging sends data to the Firebase backend periodically to collect information
150
- * regarding the app instance. To stop this, see `Messaging.deleteData()`. It
151
- * resumes with a new FCM Token the next time you call this method.
152
- *
153
- * - Parameter data Parameters to pass to the trigger.
154
- * - Throws: An error if the Cloud Functions invocation failed.
155
- * - Returns: The result of the call.
156
- */
135
+ /// Executes this Callable HTTPS trigger asynchronously.
136
+ ///
137
+ /// The request to the Cloud Functions backend made by this method automatically includes a
138
+ /// FCM token to identify the app instance. If a user is logged in with Firebase
139
+ /// Auth, an auth ID token for the user is also automatically included.
140
+ ///
141
+ /// Firebase Cloud Messaging sends data to the Firebase backend periodically to collect
142
+ /// information
143
+ /// regarding the app instance. To stop this, see `Messaging.deleteData()`. It
144
+ /// resumes with a new FCM Token the next time you call this method.
145
+ ///
146
+ /// - Parameter data: Parameters to pass to the trigger.
147
+ /// - Throws: An error if the Cloud Functions invocation failed.
148
+ /// - Returns: The result of the call.
157
149
@available ( iOS 13 , tvOS 13 , macOS 10 . 15 , macCatalyst 13 , watchOS 7 , * )
158
150
open func call( _ data: Any ? = nil ) async throws -> HTTPSCallableResult {
159
151
return try await withCheckedThrowingContinuation { continuation in
0 commit comments