| 427 | } |
| 428 | |
| 429 | initializeAppWithPath(path: string, options: FirebaseOptions = null, config?: FirebaseConfig) { |
| 430 | return new Promise((resolve, reject) => { |
| 431 | const initApp = () => { |
| 432 | try { |
| 433 | if (path.startsWith('res://')) { |
| 434 | path = NSBundle.mainBundle.pathForResourceOfType(path.replace('res://', '').replace('.plist', ''), 'plist'); |
| 435 | } else if (path.startsWith('~/')) { |
| 436 | path = knownFolders.currentApp().path + '/' + path.replace('~/', ''); |
| 437 | } |
| 438 | |
| 439 | const nativeOptions = FIROptions.alloc().initWithContentsOfFile(path); |
| 440 | |
| 441 | if (options?.apiKey) { |
| 442 | nativeOptions.APIKey = options.apiKey; |
| 443 | } |
| 444 | |
| 445 | if (options?.gcmSenderId) { |
| 446 | nativeOptions.GCMSenderID = options.gcmSenderId; |
| 447 | } |
| 448 | |
| 449 | if (options?.androidClientId) { |
| 450 | nativeOptions.androidClientID = options.androidClientId; |
| 451 | } |
| 452 | |
| 453 | if (options?.appGroupId) { |
| 454 | nativeOptions.appGroupID = options.appGroupId; |
| 455 | } |
| 456 | |
| 457 | if (options?.bundleId) { |
| 458 | nativeOptions.bundleID = options.bundleId; |
| 459 | } |
| 460 | |
| 461 | if (options?.clientId) { |
| 462 | nativeOptions.clientID = options.clientId; |
| 463 | } |
| 464 | |
| 465 | if (options?.databaseURL) { |
| 466 | nativeOptions.databaseURL = options.databaseURL; |
| 467 | } |
| 468 | |
| 469 | if (options?.deepLinkURLScheme) { |
| 470 | nativeOptions.deepLinkURLScheme = options.deepLinkURLScheme; |
| 471 | } |
| 472 | |
| 473 | if (options?.googleAppId) { |
| 474 | nativeOptions.googleAppID = options.googleAppId; |
| 475 | } |
| 476 | |
| 477 | if (options?.projectId) { |
| 478 | nativeOptions.projectID = options.projectId; |
| 479 | } |
| 480 | |
| 481 | if (options?.storageBucket) { |
| 482 | nativeOptions.storageBucket = options.storageBucket; |
| 483 | } |
| 484 | |
| 485 | if (options?.trackingId) { |
| 486 | nativeOptions.trackingID = options.trackingId; |