@react-native-firebase/app-check 18.4.0 → 18.6.0
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,14 @@
|
|
|
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
|
+
## [18.6.0](https://github.com/invertase/react-native-firebase/compare/v18.5.0...v18.6.0) (2023-10-26)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @react-native-firebase/app-check
|
|
9
|
+
|
|
10
|
+
## [18.5.0](https://github.com/invertase/react-native-firebase/compare/v18.4.0...v18.5.0) (2023-09-22)
|
|
11
|
+
|
|
12
|
+
**Note:** Version bump only for package @react-native-firebase/app-check
|
|
13
|
+
|
|
6
14
|
## [18.4.0](https://github.com/invertase/react-native-firebase/compare/v18.3.2...v18.4.0) (2023-09-11)
|
|
7
15
|
|
|
8
16
|
### Features
|
package/android/build.gradle
CHANGED
package/android/src/main/java/io/invertase/firebase/appcheck/ReactNativeFirebaseAppCheckModule.java
CHANGED
|
@@ -24,12 +24,12 @@ import com.facebook.react.bridge.*;
|
|
|
24
24
|
import com.google.android.gms.tasks.Tasks;
|
|
25
25
|
import com.google.firebase.FirebaseApp;
|
|
26
26
|
import com.google.firebase.appcheck.FirebaseAppCheck;
|
|
27
|
+
import io.invertase.firebase.common.ReactNativeFirebaseEvent;
|
|
28
|
+
import io.invertase.firebase.common.ReactNativeFirebaseEventEmitter;
|
|
27
29
|
import io.invertase.firebase.common.ReactNativeFirebaseJSON;
|
|
28
30
|
import io.invertase.firebase.common.ReactNativeFirebaseMeta;
|
|
29
31
|
import io.invertase.firebase.common.ReactNativeFirebaseModule;
|
|
30
32
|
import io.invertase.firebase.common.ReactNativeFirebasePreferences;
|
|
31
|
-
import io.invertase.firebase.common.ReactNativeFirebaseEvent;
|
|
32
|
-
import io.invertase.firebase.common.ReactNativeFirebaseEventEmitter;
|
|
33
33
|
import java.util.HashMap;
|
|
34
34
|
import java.util.Iterator;
|
|
35
35
|
import java.util.Map;
|
|
@@ -39,7 +39,8 @@ public class ReactNativeFirebaseAppCheckModule extends ReactNativeFirebaseModule
|
|
|
39
39
|
private static final String LOGTAG = "RNFBAppCheck";
|
|
40
40
|
private static final String KEY_APPCHECK_TOKEN_REFRESH_ENABLED = "app_check_token_auto_refresh";
|
|
41
41
|
|
|
42
|
-
private static HashMap<String, FirebaseAppCheck.AppCheckListener> mAppCheckListeners =
|
|
42
|
+
private static HashMap<String, FirebaseAppCheck.AppCheckListener> mAppCheckListeners =
|
|
43
|
+
new HashMap<>();
|
|
43
44
|
|
|
44
45
|
ReactNativeFirebaseAppCheckProviderFactory providerFactory =
|
|
45
46
|
new ReactNativeFirebaseAppCheckProviderFactory();
|
|
@@ -110,7 +111,8 @@ public class ReactNativeFirebaseAppCheckModule extends ReactNativeFirebaseModule
|
|
|
110
111
|
String appName = (String) pair.getKey();
|
|
111
112
|
FirebaseApp firebaseApp = FirebaseApp.getInstance(appName);
|
|
112
113
|
FirebaseAppCheck firebaseAppCheck = FirebaseAppCheck.getInstance(firebaseApp);
|
|
113
|
-
FirebaseAppCheck.AppCheckListener mAppCheckListener =
|
|
114
|
+
FirebaseAppCheck.AppCheckListener mAppCheckListener =
|
|
115
|
+
(FirebaseAppCheck.AppCheckListener) pair.getValue();
|
|
114
116
|
firebaseAppCheck.removeAppCheckListener(mAppCheckListener);
|
|
115
117
|
appCheckListenerIterator.remove();
|
|
116
118
|
}
|
|
@@ -213,16 +215,19 @@ public class ReactNativeFirebaseAppCheckModule extends ReactNativeFirebaseModule
|
|
|
213
215
|
FirebaseAppCheck firebaseAppCheck = FirebaseAppCheck.getInstance(firebaseApp);
|
|
214
216
|
|
|
215
217
|
if (mAppCheckListeners.get(appName) == null) {
|
|
216
|
-
FirebaseAppCheck.AppCheckListener newAppCheckListener =
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
218
|
+
FirebaseAppCheck.AppCheckListener newAppCheckListener =
|
|
219
|
+
appCheckToken -> {
|
|
220
|
+
WritableMap eventBody = Arguments.createMap();
|
|
221
|
+
eventBody.putString("appName", appName); // for js side distribution
|
|
222
|
+
eventBody.putString("token", appCheckToken.getToken());
|
|
223
|
+
eventBody.putDouble("expireTimeMillis", appCheckToken.getExpireTimeMillis());
|
|
224
|
+
|
|
225
|
+
ReactNativeFirebaseEventEmitter emitter =
|
|
226
|
+
ReactNativeFirebaseEventEmitter.getSharedInstance();
|
|
227
|
+
ReactNativeFirebaseEvent event =
|
|
228
|
+
new ReactNativeFirebaseEvent("appCheck_token_changed", eventBody, appName);
|
|
229
|
+
emitter.sendEvent(event);
|
|
230
|
+
};
|
|
226
231
|
|
|
227
232
|
firebaseAppCheck.addAppCheckListener(newAppCheckListener);
|
|
228
233
|
mAppCheckListeners.put(appName, newAppCheckListener);
|
package/lib/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Generated by genversion.
|
|
2
|
-
module.exports = '18.
|
|
2
|
+
module.exports = '18.6.0';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-native-firebase/app-check",
|
|
3
|
-
"version": "18.
|
|
3
|
+
"version": "18.6.0",
|
|
4
4
|
"author": "Invertase <oss@invertase.io> (http://invertase.io)",
|
|
5
5
|
"description": "React Native Firebase - App Check",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -23,10 +23,10 @@
|
|
|
23
23
|
"appCheck"
|
|
24
24
|
],
|
|
25
25
|
"peerDependencies": {
|
|
26
|
-
"@react-native-firebase/app": "18.
|
|
26
|
+
"@react-native-firebase/app": "18.6.0"
|
|
27
27
|
},
|
|
28
28
|
"publishConfig": {
|
|
29
29
|
"access": "public"
|
|
30
30
|
},
|
|
31
|
-
"gitHead": "
|
|
31
|
+
"gitHead": "adbbd4171adb1e3c2306da1285520abbaf9313b8"
|
|
32
32
|
}
|
package/type-test.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import firebase
|
|
2
|
-
import defaultExport, { firebase as firebaseFromModule } from '@react-native-firebase/app-check';
|
|
1
|
+
import firebase from '.';
|
|
3
2
|
|
|
4
3
|
// checks module exists at root
|
|
5
4
|
console.log(firebase.appCheck().app.name);
|
|
@@ -10,17 +9,14 @@ console.log(firebase.app().appCheck().app.name);
|
|
|
10
9
|
// checks statics exist
|
|
11
10
|
console.log(firebase.appCheck.SDK_VERSION);
|
|
12
11
|
|
|
13
|
-
// checks statics exist on defaultExport
|
|
14
|
-
console.log(defaultExport.SDK_VERSION);
|
|
15
|
-
|
|
16
12
|
// checks root exists
|
|
17
13
|
console.log(firebase.SDK_VERSION);
|
|
18
14
|
|
|
19
15
|
// checks firebase named export exists on module
|
|
20
|
-
console.log(
|
|
16
|
+
console.log(firebase.SDK_VERSION);
|
|
21
17
|
|
|
22
18
|
// checks multi-app support exists
|
|
23
19
|
console.log(firebase.appCheck(firebase.app()).app.name);
|
|
24
20
|
|
|
25
21
|
// checks default export supports app arg
|
|
26
|
-
console.log(
|
|
22
|
+
console.log(firebase(firebase.app()).app.name);
|