@react-native-firebase/app 14.8.0 → 14.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,22 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [14.9.1](https://github.com/invertase/react-native-firebase/compare/v14.9.0...v14.9.1) (2022-04-28)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **ios, expo:** add Expo plugin objcpp / Expo 45 compatibility ([#6223](https://github.com/invertase/react-native-firebase/issues/6223)) ([9de82d3](https://github.com/invertase/react-native-firebase/commit/9de82d356862d7dc359d90b4cd1643724de3a862))
11
+
12
+ # [14.9.0](https://github.com/invertase/react-native-firebase/compare/v14.8.1...v14.9.0) (2022-04-27)
13
+
14
+ **Note:** Version bump only for package @react-native-firebase/app
15
+
16
+ ## [14.8.1](https://github.com/invertase/react-native-firebase/compare/v14.8.0...v14.8.1) (2022-04-25)
17
+
18
+ ### Bug Fixes
19
+
20
+ - **app, expo:** Support RN 0.68 Obj-C++ AppDelegate ([#6213](https://github.com/invertase/react-native-firebase/issues/6213)) ([6f2d7e1](https://github.com/invertase/react-native-firebase/commit/6f2d7e1608d04613b77461f9647802aa1058e6cc))
21
+
6
22
  # [14.8.0](https://github.com/invertase/react-native-firebase/compare/v14.7.0...v14.8.0) (2022-04-19)
7
23
 
8
24
  ### Features
@@ -18,5 +18,5 @@ package io.invertase.firebase.app;
18
18
  */
19
19
  // generated file - do not modify or commit
20
20
  public class ReactNativeFirebaseVersion {
21
- public static String VERSION = "14.8.0";
21
+ public static String VERSION = "14.9.1";
22
22
  }
@@ -18,4 +18,4 @@
18
18
  #import <React/RCTVersion.h>
19
19
 
20
20
  // generated file - do not modify or commit
21
- NSString* const RNFBVersionString = @"14.8.0";
21
+ NSString* const RNFBVersionString = @"14.9.1";
package/lib/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // generated by genversion
2
- module.exports = '14.8.0';
2
+ module.exports = '14.9.1';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-native-firebase/app",
3
- "version": "14.8.0",
3
+ "version": "14.9.1",
4
4
  "author": "Invertase <oss@invertase.io> (http://invertase.io)",
5
5
  "description": "A well tested, feature rich Firebase implementation for React Native, supporting iOS & Android. Individual module support for Admob, Analytics, Auth, Crash Reporting, Cloud Firestore, Database, Dynamic Links, Functions, Messaging (FCM), Remote Config, Storage and more.",
6
6
  "main": "lib/index.js",
@@ -56,7 +56,7 @@
56
56
  "react-native": "*"
57
57
  },
58
58
  "dependencies": {
59
- "@expo/config-plugins": "^4.0.18",
59
+ "@expo/config-plugins": "^4.1.1",
60
60
  "opencollective-postinstall": "^2.0.1",
61
61
  "superstruct": "^0.6.2"
62
62
  },
@@ -79,5 +79,5 @@
79
79
  "playServicesAuth": "20.1.0"
80
80
  }
81
81
  },
82
- "gitHead": "6b4ac1c0227719905dec4bf008f15366706cb465"
82
+ "gitHead": "a799c14382e2448e32428e4a83bc286533e4dd35"
83
83
  }
@@ -1,3 +1,5 @@
1
1
  import { ConfigPlugin } from '@expo/config-plugins';
2
+ import { AppDelegateProjectFile } from '@expo/config-plugins/build/ios/Paths';
2
3
  export declare function modifyObjcAppDelegate(contents: string): string;
4
+ export declare function modifyAppDelegateAsync(appDelegateFileInfo: AppDelegateProjectFile): Promise<void>;
3
5
  export declare const withFirebaseAppDelegate: ConfigPlugin;
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.withFirebaseAppDelegate = exports.modifyObjcAppDelegate = void 0;
6
+ exports.withFirebaseAppDelegate = exports.modifyAppDelegateAsync = exports.modifyObjcAppDelegate = void 0;
7
7
  const config_plugins_1 = require("@expo/config-plugins");
8
8
  const generateCode_1 = require("@expo/config-plugins/build/utils/generateCode");
9
9
  const fs_1 = __importDefault(require("fs"));
@@ -17,7 +17,7 @@ function modifyObjcAppDelegate(contents) {
17
17
  // Add import
18
18
  if (!contents.includes('@import Firebase;')) {
19
19
  contents = contents.replace(/#import "AppDelegate.h"/g, `#import "AppDelegate.h"
20
- @import Firebase;`);
20
+ #import <Firebase/Firebase.h>`);
21
21
  }
22
22
  // To avoid potential issues with existing changes from older plugin versions
23
23
  if (contents.includes(methodInvocationBlock)) {
@@ -57,20 +57,24 @@ function modifyObjcAppDelegate(contents) {
57
57
  }
58
58
  }
59
59
  exports.modifyObjcAppDelegate = modifyObjcAppDelegate;
60
+ async function modifyAppDelegateAsync(appDelegateFileInfo) {
61
+ const { language, path, contents } = appDelegateFileInfo;
62
+ if (['objc', 'objcpp'].includes(language)) {
63
+ const newContents = modifyObjcAppDelegate(contents);
64
+ await fs_1.default.promises.writeFile(path, newContents);
65
+ }
66
+ else {
67
+ // TODO: Support Swift
68
+ throw new Error(`Cannot add Firebase code to AppDelegate of language "${language}"`);
69
+ }
70
+ }
71
+ exports.modifyAppDelegateAsync = modifyAppDelegateAsync;
60
72
  const withFirebaseAppDelegate = config => {
61
73
  return (0, config_plugins_1.withDangerousMod)(config, [
62
74
  'ios',
63
75
  async (config) => {
64
76
  const fileInfo = config_plugins_1.IOSConfig.Paths.getAppDelegate(config.modRequest.projectRoot);
65
- let contents = await fs_1.default.promises.readFile(fileInfo.path, 'utf-8');
66
- if (fileInfo.language === 'objc') {
67
- contents = modifyObjcAppDelegate(contents);
68
- }
69
- else {
70
- // TODO: Support Swift
71
- throw new Error(`Cannot add Firebase code to AppDelegate of language "${fileInfo.language}"`);
72
- }
73
- await fs_1.default.promises.writeFile(fileInfo.path, contents);
77
+ await modifyAppDelegateAsync(fileInfo);
74
78
  return config;
75
79
  },
76
80
  ]);
@@ -1,4 +1,5 @@
1
1
  import { ConfigPlugin, IOSConfig, WarningAggregator, withDangerousMod } from '@expo/config-plugins';
2
+ import { AppDelegateProjectFile } from '@expo/config-plugins/build/ios/Paths';
2
3
  import { mergeContents } from '@expo/config-plugins/build/utils/generateCode';
3
4
  import fs from 'fs';
4
5
 
@@ -18,7 +19,7 @@ export function modifyObjcAppDelegate(contents: string): string {
18
19
  contents = contents.replace(
19
20
  /#import "AppDelegate.h"/g,
20
21
  `#import "AppDelegate.h"
21
- @import Firebase;`,
22
+ #import <Firebase/Firebase.h>`,
22
23
  );
23
24
  }
24
25
 
@@ -67,22 +68,24 @@ export function modifyObjcAppDelegate(contents: string): string {
67
68
  }
68
69
  }
69
70
 
71
+ export async function modifyAppDelegateAsync(appDelegateFileInfo: AppDelegateProjectFile) {
72
+ const { language, path, contents } = appDelegateFileInfo;
73
+
74
+ if (['objc', 'objcpp'].includes(language)) {
75
+ const newContents = modifyObjcAppDelegate(contents);
76
+ await fs.promises.writeFile(path, newContents);
77
+ } else {
78
+ // TODO: Support Swift
79
+ throw new Error(`Cannot add Firebase code to AppDelegate of language "${language}"`);
80
+ }
81
+ }
82
+
70
83
  export const withFirebaseAppDelegate: ConfigPlugin = config => {
71
84
  return withDangerousMod(config, [
72
85
  'ios',
73
86
  async config => {
74
87
  const fileInfo = IOSConfig.Paths.getAppDelegate(config.modRequest.projectRoot);
75
- let contents = await fs.promises.readFile(fileInfo.path, 'utf-8');
76
- if (fileInfo.language === 'objc') {
77
- contents = modifyObjcAppDelegate(contents);
78
- } else {
79
- // TODO: Support Swift
80
- throw new Error(
81
- `Cannot add Firebase code to AppDelegate of language "${fileInfo.language}"`,
82
- );
83
- }
84
- await fs.promises.writeFile(fileInfo.path, contents);
85
-
88
+ await modifyAppDelegateAsync(fileInfo);
86
89
  return config;
87
90
  },
88
91
  ]);