MCPcopy Create free account
hub / github.com/NativeScript/firebase / constructor

Method constructor

packages/firebase-functions/index.ios.ts:139–165  ·  view source on GitHub ↗
(app?: FirebaseApp)

Source from the content-addressed store, hash-verified

137 _app: FirebaseApp;
138
139 constructor(app?: FirebaseApp) {
140 if (app?.native) {
141 if (defaultRegionOrCustomDomain) {
142 this._native = isRegion(defaultRegionOrCustomDomain) // Check whether a Region has been set
143 ? FIRFunctions.functionsForAppRegion(app.native, defaultRegionOrCustomDomain) // @see https://firebase.google.com/docs/reference/ios/firebasefunctions/api/reference/Classes/FIRFunctions_+functionsforapp:region:
144 : isCustomDomain(defaultRegionOrCustomDomain) // Check whether using a Custom Domain has been set
145 ? FIRFunctions.functionsForAppCustomDomain(app.native, defaultRegionOrCustomDomain) // @see https://firebase.google.com/docs/reference/ios/firebasefunctions/api/reference/Classes/FIRFunctions_+functionsforapp:customdomain:
146 : FIRFunctions.functionsForApp(app.native); // @see https://firebase.google.com/docs/reference/ios/firebasefunctions/api/reference/Classes/FIRFunctions_+functionsforapp:
147 } else {
148 this._native = FIRFunctions.functionsForApp(app.native); // @see https://firebase.google.com/docs/reference/ios/firebasefunctions/api/reference/Classes/FIRFunctions_+functionsforapp:
149 }
150 } else {
151 if (defaultFunctions) {
152 return defaultFunctions;
153 }
154 defaultFunctions = this;
155 if (defaultRegionOrCustomDomain) {
156 this._native = isRegion(defaultRegionOrCustomDomain) // Check whether a Region has been set
157 ? FIRFunctions.functionsForRegion(defaultRegionOrCustomDomain) // @see https://firebase.google.com/docs/reference/ios/firebasefunctions/api/reference/Classes/FIRFunctions_+functionsforregion:
158 : isCustomDomain(defaultRegionOrCustomDomain) // Check whether using a Custom Domain has been set
159 ? FIRFunctions.functionsForCustomDomain(defaultRegionOrCustomDomain) // @see https://firebase.google.com/docs/reference/ios/firebasefunctions/api/reference/Classes/FIRFunctions_+functionsforcustomdomain:
160 : FIRFunctions.functions(); // @see https://firebase.google.com/docs/reference/ios/firebasefunctions/api/reference/Classes/FIRFunctions_+functions
161 } else {
162 this._native = FIRFunctions.functions(); // @see https://firebase.google.com/docs/reference/ios/firebasefunctions/api/reference/Classes/FIRFunctions_+functions
163 }
164 }
165 }
166
167 httpsCallable(name: string, options?: HttpsCallableOptions): HttpsCallable {
168 const callable = this.native.HTTPSCallableWithName(name);

Callers

nothing calls this directly

Calls 3

isRegionFunction · 0.85
isCustomDomainFunction · 0.85
functionsMethod · 0.65

Tested by

no test coverage detected