MCPcopy Index your code
hub / github.com/NativeScript/firebase / httpsCallable

Method httpsCallable

packages/firebase-functions/index.ios.ts:167–193  ·  view source on GitHub ↗
(name: string, options?: HttpsCallableOptions)

Source from the content-addressed store, hash-verified

165 }
166
167 httpsCallable(name: string, options?: HttpsCallableOptions): HttpsCallable {
168 const callable = this.native.HTTPSCallableWithName(name);
169 if (typeof options?.timeout === 'number') {
170 callable.timeoutInterval = options.timeout;
171 }
172 return (data: any) => {
173 return new Promise((resolve, reject) => {
174 if (data) {
175 callable.callWithObjectCompletion(serialize(data), (result, error) => {
176 if (error) {
177 reject(toHttpsError(error));
178 } else {
179 resolve(deserialize(result.data));
180 }
181 });
182 } else {
183 callable.callWithCompletion((result, error) => {
184 if (error) {
185 reject(toHttpsError(error));
186 } else {
187 resolve(deserialize(result.data));
188 }
189 });
190 }
191 });
192 };
193 }
194
195 useEmulator(host: string, port: number) {
196 this.native.useEmulatorWithHostPort(host, port);

Callers

nothing calls this directly

Calls 3

serializeFunction · 0.90
deserializeFunction · 0.90
toHttpsErrorFunction · 0.70

Tested by

no test coverage detected