@react-native-firebase/installations 25.0.1 → 26.0.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 +19 -0
- package/README.md +5 -6
- package/RNFBInstallations.podspec +7 -6
- package/android/build.gradle +19 -0
- package/android/src/main/java/io/invertase/firebase/installations/{ReactNativeFirebaseInstallationsModule.java → NativeRNFBTurboInstallations.java} +34 -28
- package/android/src/main/java/io/invertase/firebase/installations/ReactNativeFirebaseInstallationsPackage.java +1 -1
- package/android/src/main/java/io/invertase/firebase/installations/generated/java/com/facebook/fbreact/specs/NativeRNFBTurboInstallationsSpec.java +46 -0
- package/android/src/main/java/io/invertase/firebase/installations/generated/jni/CMakeLists.txt +36 -0
- package/android/src/main/java/io/invertase/firebase/installations/generated/jni/RNFBInstallationsTurboModules-generated.cpp +44 -0
- package/android/src/main/java/io/invertase/firebase/installations/generated/jni/RNFBInstallationsTurboModules.h +31 -0
- package/android/src/main/java/io/invertase/firebase/installations/generated/jni/react/renderer/components/RNFBInstallationsTurboModules/RNFBInstallationsTurboModulesJSI-generated.cpp +42 -0
- package/android/src/main/java/io/invertase/firebase/installations/generated/jni/react/renderer/components/RNFBInstallationsTurboModules/RNFBInstallationsTurboModulesJSI.h +89 -0
- package/dist/module/index.js +81 -6
- package/dist/module/index.js.map +1 -1
- package/dist/module/version.js +1 -1
- package/dist/typescript/lib/index.d.ts +35 -5
- package/dist/typescript/lib/index.d.ts.map +1 -1
- package/dist/typescript/lib/types/internal.d.ts +8 -9
- package/dist/typescript/lib/types/internal.d.ts.map +1 -1
- package/dist/typescript/lib/version.d.ts +1 -1
- package/ios/RNFBInstallations/RNFBInstallationsModule.h +3 -3
- package/ios/RNFBInstallations/{RNFBInstallationsModule.m → RNFBInstallationsModule.mm} +24 -23
- package/ios/RNFBInstallations.xcodeproj/project.pbxproj +8 -8
- package/ios/generated/RCTAppDependencyProvider.h +25 -0
- package/ios/generated/RCTAppDependencyProvider.mm +55 -0
- package/ios/generated/RCTModulesConformingToProtocolsProvider.h +18 -0
- package/ios/generated/RCTModulesConformingToProtocolsProvider.mm +33 -0
- package/ios/generated/RCTThirdPartyComponentsProvider.h +16 -0
- package/ios/generated/RCTThirdPartyComponentsProvider.mm +23 -0
- package/ios/generated/RNFBInstallationsTurboModules/RNFBInstallationsTurboModules-generated.mm +53 -0
- package/ios/generated/RNFBInstallationsTurboModules/RNFBInstallationsTurboModules.h +71 -0
- package/ios/generated/RNFBInstallationsTurboModulesJSI-generated.cpp +42 -0
- package/ios/generated/RNFBInstallationsTurboModulesJSI.h +89 -0
- package/ios/generated/ReactAppDependencyProvider.podspec +34 -0
- package/lib/index.ts +111 -8
- package/lib/types/internal.ts +10 -15
- package/lib/version.ts +1 -1
- package/package.json +22 -4
- package/react-native.config.js +10 -0
- package/specs/NativeRNFBTurboInstallations.ts +10 -0
- package/typedoc.json +1 -1
- package/dist/module/modular.js +0 -68
- package/dist/module/modular.js.map +0 -1
- package/dist/module/namespaced.js +0 -72
- package/dist/module/namespaced.js.map +0 -1
- package/dist/module/types/namespaced.js +0 -33
- package/dist/module/types/namespaced.js.map +0 -1
- package/dist/typescript/lib/modular.d.ts +0 -25
- package/dist/typescript/lib/modular.d.ts.map +0 -1
- package/dist/typescript/lib/namespaced.d.ts +0 -12
- package/dist/typescript/lib/namespaced.d.ts.map +0 -1
- package/dist/typescript/lib/types/namespaced.d.ts +0 -77
- package/dist/typescript/lib/types/namespaced.d.ts.map +0 -1
- package/lib/modular.ts +0 -80
- package/lib/namespaced.ts +0 -100
- package/lib/types/namespaced.ts +0 -112
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was generated by [react-native-codegen](https://www.npmjs.com/package/react-native-codegen).
|
|
3
|
+
*
|
|
4
|
+
* Do not edit this file as changes may cause incorrect behavior and will be lost
|
|
5
|
+
* once the code is regenerated.
|
|
6
|
+
*
|
|
7
|
+
* @generated by codegen project: GenerateModuleH.js
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
#pragma once
|
|
11
|
+
|
|
12
|
+
#include <ReactCommon/TurboModule.h>
|
|
13
|
+
#include <react/bridging/Bridging.h>
|
|
14
|
+
|
|
15
|
+
namespace facebook::react {
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class JSI_EXPORT NativeRNFBTurboInstallationsCxxSpecJSI : public TurboModule {
|
|
19
|
+
protected:
|
|
20
|
+
NativeRNFBTurboInstallationsCxxSpecJSI(std::shared_ptr<CallInvoker> jsInvoker);
|
|
21
|
+
|
|
22
|
+
public:
|
|
23
|
+
virtual jsi::Value deleteInstallations(jsi::Runtime &rt, jsi::String appName) = 0;
|
|
24
|
+
virtual jsi::Value getId(jsi::Runtime &rt, jsi::String appName) = 0;
|
|
25
|
+
virtual jsi::Value getToken(jsi::Runtime &rt, jsi::String appName, bool forceRefresh) = 0;
|
|
26
|
+
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
template <typename T>
|
|
30
|
+
class JSI_EXPORT NativeRNFBTurboInstallationsCxxSpec : public TurboModule {
|
|
31
|
+
public:
|
|
32
|
+
jsi::Value create(jsi::Runtime &rt, const jsi::PropNameID &propName) override {
|
|
33
|
+
return delegate_.create(rt, propName);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
std::vector<jsi::PropNameID> getPropertyNames(jsi::Runtime& runtime) override {
|
|
37
|
+
return delegate_.getPropertyNames(runtime);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
static constexpr std::string_view kModuleName = "NativeRNFBTurboInstallations";
|
|
41
|
+
|
|
42
|
+
protected:
|
|
43
|
+
NativeRNFBTurboInstallationsCxxSpec(std::shared_ptr<CallInvoker> jsInvoker)
|
|
44
|
+
: TurboModule(std::string{NativeRNFBTurboInstallationsCxxSpec::kModuleName}, jsInvoker),
|
|
45
|
+
delegate_(reinterpret_cast<T*>(this), jsInvoker) {}
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
private:
|
|
49
|
+
class Delegate : public NativeRNFBTurboInstallationsCxxSpecJSI {
|
|
50
|
+
public:
|
|
51
|
+
Delegate(T *instance, std::shared_ptr<CallInvoker> jsInvoker) :
|
|
52
|
+
NativeRNFBTurboInstallationsCxxSpecJSI(std::move(jsInvoker)), instance_(instance) {
|
|
53
|
+
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
jsi::Value deleteInstallations(jsi::Runtime &rt, jsi::String appName) override {
|
|
57
|
+
static_assert(
|
|
58
|
+
bridging::getParameterCount(&T::deleteInstallations) == 2,
|
|
59
|
+
"Expected deleteInstallations(...) to have 2 parameters");
|
|
60
|
+
|
|
61
|
+
return bridging::callFromJs<jsi::Value>(
|
|
62
|
+
rt, &T::deleteInstallations, jsInvoker_, instance_, std::move(appName));
|
|
63
|
+
}
|
|
64
|
+
jsi::Value getId(jsi::Runtime &rt, jsi::String appName) override {
|
|
65
|
+
static_assert(
|
|
66
|
+
bridging::getParameterCount(&T::getId) == 2,
|
|
67
|
+
"Expected getId(...) to have 2 parameters");
|
|
68
|
+
|
|
69
|
+
return bridging::callFromJs<jsi::Value>(
|
|
70
|
+
rt, &T::getId, jsInvoker_, instance_, std::move(appName));
|
|
71
|
+
}
|
|
72
|
+
jsi::Value getToken(jsi::Runtime &rt, jsi::String appName, bool forceRefresh) override {
|
|
73
|
+
static_assert(
|
|
74
|
+
bridging::getParameterCount(&T::getToken) == 3,
|
|
75
|
+
"Expected getToken(...) to have 3 parameters");
|
|
76
|
+
|
|
77
|
+
return bridging::callFromJs<jsi::Value>(
|
|
78
|
+
rt, &T::getToken, jsInvoker_, instance_, std::move(appName), std::move(forceRefresh));
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
private:
|
|
82
|
+
friend class NativeRNFBTurboInstallationsCxxSpec;
|
|
83
|
+
T *instance_;
|
|
84
|
+
};
|
|
85
|
+
|
|
86
|
+
Delegate delegate_;
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
} // namespace facebook::react
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
#
|
|
3
|
+
# This source code is licensed under the MIT license found in the
|
|
4
|
+
# LICENSE file in the root directory of this source tree.
|
|
5
|
+
|
|
6
|
+
version = "0.78.3"
|
|
7
|
+
source = { :git => 'https://github.com/facebook/react-native.git' }
|
|
8
|
+
if version == '1000.0.0'
|
|
9
|
+
# This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.
|
|
10
|
+
source[:commit] = `git rev-parse HEAD`.strip if system("git rev-parse --git-dir > /dev/null 2>&1")
|
|
11
|
+
else
|
|
12
|
+
source[:tag] = "v#{version}"
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
Pod::Spec.new do |s|
|
|
16
|
+
s.name = "ReactAppDependencyProvider"
|
|
17
|
+
s.version = version
|
|
18
|
+
s.summary = "The third party dependency provider for the app"
|
|
19
|
+
s.homepage = "https://reactnative.dev/"
|
|
20
|
+
s.documentation_url = "https://reactnative.dev/"
|
|
21
|
+
s.license = "MIT"
|
|
22
|
+
s.author = "Meta Platforms, Inc. and its affiliates"
|
|
23
|
+
s.platforms = min_supported_versions
|
|
24
|
+
s.source = source
|
|
25
|
+
s.source_files = "**/RCTAppDependencyProvider.{h,mm}"
|
|
26
|
+
|
|
27
|
+
# This guard prevent to install the dependencies when we run `pod install` in the old architecture.
|
|
28
|
+
s.pod_target_xcconfig = {
|
|
29
|
+
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
|
|
30
|
+
"DEFINES_MODULE" => "YES"
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
s.dependency "ReactCodegen"
|
|
34
|
+
end
|
package/lib/index.ts
CHANGED
|
@@ -15,13 +15,116 @@
|
|
|
15
15
|
*
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
import { isIOS } from '@react-native-firebase/app/dist/module/common';
|
|
19
|
+
import {
|
|
20
|
+
FirebaseModule,
|
|
21
|
+
getOrCreateModularInstance,
|
|
22
|
+
} from '@react-native-firebase/app/dist/module/internal';
|
|
23
|
+
import type { ModuleConfig } from '@react-native-firebase/app/dist/module/internal';
|
|
24
|
+
import './types/internal';
|
|
25
|
+
import type { FirebaseApp } from '@react-native-firebase/app';
|
|
26
|
+
import type {
|
|
27
|
+
IdChangeCallbackFn,
|
|
28
|
+
IdChangeUnsubscribeFn,
|
|
29
|
+
Installations,
|
|
30
|
+
} from './types/installations';
|
|
31
|
+
import type { InstallationsInternal } from './types/internal';
|
|
32
|
+
import { version } from './version';
|
|
20
33
|
|
|
21
|
-
|
|
22
|
-
export * from './modular';
|
|
34
|
+
const nativeModuleName = 'NativeRNFBTurboInstallations';
|
|
23
35
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
36
|
+
class FirebaseInstallationsModule extends FirebaseModule<typeof nativeModuleName> {
|
|
37
|
+
getId(): Promise<string> {
|
|
38
|
+
return this.native.getId();
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
getToken(forceRefresh?: boolean): Promise<string> {
|
|
42
|
+
if (!forceRefresh) {
|
|
43
|
+
return this.native.getToken(false);
|
|
44
|
+
} else {
|
|
45
|
+
return this.native.getToken(true);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
delete(): Promise<void> {
|
|
50
|
+
return this.native.deleteInstallations();
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
onIdChange(): () => void {
|
|
54
|
+
if (isIOS) {
|
|
55
|
+
return () => {};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// TODO implement change listener on Android
|
|
59
|
+
return () => {};
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const config: ModuleConfig = {
|
|
64
|
+
namespace: 'installations',
|
|
65
|
+
nativeModuleName,
|
|
66
|
+
nativeEvents: false, // TODO implement android id change listener: ['installations_id_changed'],
|
|
67
|
+
hasMultiAppSupport: true,
|
|
68
|
+
hasCustomUrlOrRegionSupport: false,
|
|
69
|
+
turboModule: true,
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* RN Firebase package version string exported from the modular entry point.
|
|
74
|
+
*
|
|
75
|
+
* The firebase-js-sdk does not export `SDK_VERSION` from `@firebase/installations`.
|
|
76
|
+
*/
|
|
77
|
+
export const SDK_VERSION = version;
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Returns the {@link Installations} instance for the default or given {@link FirebaseApp}.
|
|
81
|
+
*
|
|
82
|
+
* @param app - The Firebase `FirebaseApp` to use. When omitted, the default app is used.
|
|
83
|
+
* @returns The Installations service instance for that app.
|
|
84
|
+
*/
|
|
85
|
+
export function getInstallations(app?: FirebaseApp): Installations {
|
|
86
|
+
return getOrCreateModularInstance(
|
|
87
|
+
FirebaseInstallationsModule,
|
|
88
|
+
config,
|
|
89
|
+
app,
|
|
90
|
+
) as unknown as Installations;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Deletes the Firebase Installation and all associated data.
|
|
95
|
+
*/
|
|
96
|
+
export function deleteInstallations(installations: Installations): Promise<void> {
|
|
97
|
+
return (installations as InstallationsInternal).delete();
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Creates a Firebase Installation if there isn't one for the app and returns the Installation ID.
|
|
102
|
+
*/
|
|
103
|
+
export function getId(installations: Installations): Promise<string> {
|
|
104
|
+
return (installations as InstallationsInternal).getId();
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Returns a Firebase Installations auth token, identifying the current Firebase Installation.
|
|
109
|
+
*/
|
|
110
|
+
export function getToken(installations: Installations, forceRefresh?: boolean): Promise<string> {
|
|
111
|
+
return (installations as InstallationsInternal).getToken(forceRefresh);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Throw an error since react-native-firebase does not support this method.
|
|
116
|
+
*
|
|
117
|
+
* Sets a new callback that will get called when Installation ID changes. Returns an unsubscribe function that will remove the callback when called.
|
|
118
|
+
*/
|
|
119
|
+
export function onIdChange(
|
|
120
|
+
_installations: Installations,
|
|
121
|
+
_callback: IdChangeCallbackFn,
|
|
122
|
+
): IdChangeUnsubscribeFn {
|
|
123
|
+
throw new Error('onIdChange() is unsupported by the React Native Firebase SDK.');
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export type {
|
|
127
|
+
IdChangeCallbackFn,
|
|
128
|
+
IdChangeUnsubscribeFn,
|
|
129
|
+
Installations,
|
|
130
|
+
} from './types/installations';
|
package/lib/types/internal.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Copyright (c) 2016-present Invertase Limited & Contributors
|
|
3
3
|
*
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this
|
|
5
|
+
* you may not use this library except in compliance with the License.
|
|
6
6
|
* You may obtain a copy of the License at
|
|
7
7
|
*
|
|
8
8
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
@@ -17,26 +17,21 @@
|
|
|
17
17
|
|
|
18
18
|
import type { Installations } from './installations';
|
|
19
19
|
|
|
20
|
-
/** Optional final argument passed by modular API wrappers (MODULAR_DEPRECATION_ARG). */
|
|
21
|
-
export type InstallationsModularDeprecationArg = string;
|
|
22
|
-
|
|
23
|
-
export interface InstallationsInternal extends Installations {
|
|
24
|
-
delete(deprecationArg?: InstallationsModularDeprecationArg): Promise<void>;
|
|
25
|
-
getId(deprecationArg?: InstallationsModularDeprecationArg): Promise<string>;
|
|
26
|
-
getToken(
|
|
27
|
-
forceRefresh?: boolean,
|
|
28
|
-
deprecationArg?: InstallationsModularDeprecationArg,
|
|
29
|
-
): Promise<string>;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
20
|
export interface RNFBInstallationsModule {
|
|
33
21
|
getId(): Promise<string>;
|
|
34
22
|
getToken(forceRefresh: boolean): Promise<string>;
|
|
35
|
-
|
|
23
|
+
deleteInstallations(): Promise<void>;
|
|
36
24
|
}
|
|
37
25
|
|
|
38
26
|
declare module '@react-native-firebase/app/dist/module/internal/NativeModules' {
|
|
39
27
|
interface ReactNativeFirebaseNativeModules {
|
|
40
|
-
|
|
28
|
+
NativeRNFBTurboInstallations: RNFBInstallationsModule;
|
|
41
29
|
}
|
|
42
30
|
}
|
|
31
|
+
|
|
32
|
+
export interface InstallationsInternal extends Installations {
|
|
33
|
+
getId(): Promise<string>;
|
|
34
|
+
getToken(forceRefresh?: boolean): Promise<string>;
|
|
35
|
+
delete(): Promise<void>;
|
|
36
|
+
readonly native: RNFBInstallationsModule;
|
|
37
|
+
}
|
package/lib/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Generated by genversion.
|
|
2
|
-
export const version = '
|
|
2
|
+
export const version = '26.0.0';
|
package/package.json
CHANGED
|
@@ -1,15 +1,32 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-native-firebase/installations",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "26.0.0",
|
|
4
4
|
"author": "Invertase <oss@invertase.io> (http://invertase.io)",
|
|
5
5
|
"description": "React Native Firebase - Installations",
|
|
6
6
|
"main": "./dist/module/index.js",
|
|
7
7
|
"types": "./dist/typescript/lib/index.d.ts",
|
|
8
|
+
"codegenConfig": {
|
|
9
|
+
"name": "RNFBInstallationsTurboModules",
|
|
10
|
+
"type": "modules",
|
|
11
|
+
"jsSrcsDir": "specs",
|
|
12
|
+
"includesGeneratedCode": true,
|
|
13
|
+
"android": {
|
|
14
|
+
"javaPackageName": "io.invertase.firebase.installations"
|
|
15
|
+
},
|
|
16
|
+
"ios": {
|
|
17
|
+
"modulesProvider": {
|
|
18
|
+
"NativeRNFBTurboInstallations": "RNFBInstallationsModule"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
},
|
|
8
22
|
"scripts": {
|
|
9
23
|
"build": "genversion --esm --semi lib/version.ts",
|
|
10
24
|
"build:clean": "rimraf android/build && rimraf ios/build",
|
|
11
25
|
"compile": "bob build",
|
|
12
|
-
"prepare": "yarn run build && yarn compile"
|
|
26
|
+
"prepare": "yarn run build && yarn compile",
|
|
27
|
+
"codegen": "yarn android:codegen && yarn ios:codegen",
|
|
28
|
+
"android:codegen": "npx @react-native-community/cli codegen --platform android --outputPath=./android/src/main/java/io/invertase/firebase/installations/generated",
|
|
29
|
+
"ios:codegen": "npx @react-native-community/cli codegen --platform ios --outputPath=./ios/generated"
|
|
13
30
|
},
|
|
14
31
|
"repository": {
|
|
15
32
|
"type": "git",
|
|
@@ -23,13 +40,14 @@
|
|
|
23
40
|
"installations"
|
|
24
41
|
],
|
|
25
42
|
"peerDependencies": {
|
|
26
|
-
"@react-native-firebase/app": "
|
|
43
|
+
"@react-native-firebase/app": "26.0.0"
|
|
27
44
|
},
|
|
28
45
|
"publishConfig": {
|
|
29
46
|
"access": "public",
|
|
30
47
|
"provenance": true
|
|
31
48
|
},
|
|
32
49
|
"devDependencies": {
|
|
50
|
+
"@react-native-firebase/app": "26.0.0",
|
|
33
51
|
"react-native-builder-bob": "^0.40.13"
|
|
34
52
|
},
|
|
35
53
|
"exports": {
|
|
@@ -58,5 +76,5 @@
|
|
|
58
76
|
]
|
|
59
77
|
]
|
|
60
78
|
},
|
|
61
|
-
"gitHead": "
|
|
79
|
+
"gitHead": "2a360acb2aebdd39dd40e31be386b30697270626"
|
|
62
80
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { TurboModule } from 'react-native';
|
|
2
|
+
import { TurboModuleRegistry } from 'react-native';
|
|
3
|
+
|
|
4
|
+
export interface Spec extends TurboModule {
|
|
5
|
+
deleteInstallations(appName: string): Promise<void>;
|
|
6
|
+
getId(appName: string): Promise<string>;
|
|
7
|
+
getToken(appName: string, forceRefresh: boolean): Promise<string>;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export default TurboModuleRegistry.getEnforcing<Spec>('NativeRNFBTurboInstallations');
|
package/typedoc.json
CHANGED
package/dist/module/modular.js
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/*
|
|
4
|
-
* Copyright (c) 2016-present Invertase Limited & Contributors
|
|
5
|
-
*
|
|
6
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
-
* you may not use this library except in compliance with the License.
|
|
8
|
-
* You may obtain a copy of the License at
|
|
9
|
-
*
|
|
10
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
-
*
|
|
12
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
-
* See the License for the specific language governing permissions and
|
|
16
|
-
* limitations under the License.
|
|
17
|
-
*
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
import { getApp } from '@react-native-firebase/app';
|
|
21
|
-
import { MODULAR_DEPRECATION_ARG } from '@react-native-firebase/app/dist/module/common';
|
|
22
|
-
function withModularDeprecationArg(installations) {
|
|
23
|
-
return installations;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Returns an instance of Installations associated with the given FirebaseApp instance.
|
|
28
|
-
*/
|
|
29
|
-
export function getInstallations(app) {
|
|
30
|
-
if (app) {
|
|
31
|
-
return getApp(app.name).installations();
|
|
32
|
-
}
|
|
33
|
-
return getApp().installations();
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Deletes the Firebase Installation and all associated data.
|
|
38
|
-
*/
|
|
39
|
-
export function deleteInstallations(installations) {
|
|
40
|
-
const internalInstallations = withModularDeprecationArg(installations);
|
|
41
|
-
return internalInstallations.delete.call(internalInstallations, MODULAR_DEPRECATION_ARG);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Creates a Firebase Installation if there isn't one for the app and returns the Installation ID.
|
|
46
|
-
*/
|
|
47
|
-
export function getId(installations) {
|
|
48
|
-
const internalInstallations = withModularDeprecationArg(installations);
|
|
49
|
-
return internalInstallations.getId.call(internalInstallations, MODULAR_DEPRECATION_ARG);
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Returns a Firebase Installations auth token, identifying the current Firebase Installation.
|
|
54
|
-
*/
|
|
55
|
-
export function getToken(installations, forceRefresh) {
|
|
56
|
-
const internalInstallations = withModularDeprecationArg(installations);
|
|
57
|
-
return internalInstallations.getToken.call(internalInstallations, forceRefresh, MODULAR_DEPRECATION_ARG);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Throw an error since react-native-firebase does not support this method.
|
|
62
|
-
*
|
|
63
|
-
* Sets a new callback that will get called when Installation ID changes. Returns an unsubscribe function that will remove the callback when called.
|
|
64
|
-
*/
|
|
65
|
-
export function onIdChange(_installations, _callback) {
|
|
66
|
-
throw new Error('onIdChange() is unsupported by the React Native Firebase SDK.');
|
|
67
|
-
}
|
|
68
|
-
//# sourceMappingURL=modular.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["getApp","MODULAR_DEPRECATION_ARG","withModularDeprecationArg","installations","getInstallations","app","name","deleteInstallations","internalInstallations","delete","call","getId","getToken","forceRefresh","onIdChange","_installations","_callback","Error"],"sourceRoot":"../../lib","sources":["modular.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,MAAM,QAAQ,4BAA4B;AAEnD,SAASC,uBAAuB,QAAQ,+CAA+C;AAQvF,SAASC,yBAAyBA,CAACC,aAA4B,EAAyB;EACtF,OAAOA,aAAa;AACtB;;AAEA;AACA;AACA;AACA,OAAO,SAASC,gBAAgBA,CAACC,GAAiB,EAAiB;EACjE,IAAIA,GAAG,EAAE;IACP,OAAOL,MAAM,CAACK,GAAG,CAACC,IAAI,CAAC,CAACH,aAAa,CAAC,CAAC;EACzC;EACA,OAAOH,MAAM,CAAC,CAAC,CAACG,aAAa,CAAC,CAAC;AACjC;;AAEA;AACA;AACA;AACA,OAAO,SAASI,mBAAmBA,CAACJ,aAA4B,EAAiB;EAC/E,MAAMK,qBAAqB,GAAGN,yBAAyB,CAACC,aAAa,CAAC;EACtE,OAAOK,qBAAqB,CAACC,MAAM,CAACC,IAAI,CAACF,qBAAqB,EAAEP,uBAAuB,CAAC;AAC1F;;AAEA;AACA;AACA;AACA,OAAO,SAASU,KAAKA,CAACR,aAA4B,EAAmB;EACnE,MAAMK,qBAAqB,GAAGN,yBAAyB,CAACC,aAAa,CAAC;EACtE,OAAOK,qBAAqB,CAACG,KAAK,CAACD,IAAI,CAACF,qBAAqB,EAAEP,uBAAuB,CAAC;AACzF;;AAEA;AACA;AACA;AACA,OAAO,SAASW,QAAQA,CAACT,aAA4B,EAAEU,YAAsB,EAAmB;EAC9F,MAAML,qBAAqB,GAAGN,yBAAyB,CAACC,aAAa,CAAC;EACtE,OAAOK,qBAAqB,CAACI,QAAQ,CAACF,IAAI,CACxCF,qBAAqB,EACrBK,YAAY,EACZZ,uBACF,CAAC;AACH;;AAEA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASa,UAAUA,CACxBC,cAA6B,EAC7BC,SAA6B,EACN;EACvB,MAAM,IAAIC,KAAK,CAAC,+DAA+D,CAAC;AAClF","ignoreList":[]}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/*
|
|
4
|
-
* Copyright (c) 2016-present Invertase Limited & Contributors
|
|
5
|
-
*
|
|
6
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
-
* you may not use this library except in compliance with the License.
|
|
8
|
-
* You may obtain a copy of the License at
|
|
9
|
-
*
|
|
10
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
-
*
|
|
12
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
-
* See the License for the specific language governing permissions and
|
|
16
|
-
* limitations under the License.
|
|
17
|
-
*
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
import { isIOS } from '@react-native-firebase/app/dist/module/common';
|
|
21
|
-
import { createModuleNamespace, FirebaseModule, getFirebaseRoot } from '@react-native-firebase/app/dist/module/internal';
|
|
22
|
-
import { version } from "./version.js";
|
|
23
|
-
const statics = {};
|
|
24
|
-
const namespace = 'installations';
|
|
25
|
-
const nativeModuleName = 'RNFBInstallationsModule';
|
|
26
|
-
class FirebaseInstallationsModule extends FirebaseModule {
|
|
27
|
-
getId() {
|
|
28
|
-
return this.native.getId();
|
|
29
|
-
}
|
|
30
|
-
getToken(forceRefresh) {
|
|
31
|
-
if (!forceRefresh) {
|
|
32
|
-
return this.native.getToken(false);
|
|
33
|
-
} else {
|
|
34
|
-
return this.native.getToken(true);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
delete() {
|
|
38
|
-
return this.native.delete();
|
|
39
|
-
}
|
|
40
|
-
onIdChange() {
|
|
41
|
-
if (isIOS) {
|
|
42
|
-
return () => {};
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// TODO implement change listener on Android
|
|
46
|
-
return () => {};
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// import { SDK_VERSION } from '@react-native-firebase/installations';
|
|
51
|
-
export const SDK_VERSION = version;
|
|
52
|
-
|
|
53
|
-
// import installations from '@react-native-firebase/installations';
|
|
54
|
-
// installations().X(...);
|
|
55
|
-
const installationsNamespace = createModuleNamespace({
|
|
56
|
-
statics,
|
|
57
|
-
version,
|
|
58
|
-
namespace,
|
|
59
|
-
nativeModuleName,
|
|
60
|
-
nativeEvents: false,
|
|
61
|
-
// TODO implement android id change listener: ['installations_id_changed'],
|
|
62
|
-
hasMultiAppSupport: true,
|
|
63
|
-
hasCustomUrlOrRegionSupport: false,
|
|
64
|
-
ModuleClass: FirebaseInstallationsModule
|
|
65
|
-
});
|
|
66
|
-
export default installationsNamespace;
|
|
67
|
-
|
|
68
|
-
// import installations, { firebase } from '@react-native-firebase/installations';
|
|
69
|
-
// installations().X(...);
|
|
70
|
-
// firebase.installations().X(...);
|
|
71
|
-
export const firebase = getFirebaseRoot();
|
|
72
|
-
//# sourceMappingURL=namespaced.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["isIOS","createModuleNamespace","FirebaseModule","getFirebaseRoot","version","statics","namespace","nativeModuleName","FirebaseInstallationsModule","getId","native","getToken","forceRefresh","delete","onIdChange","SDK_VERSION","installationsNamespace","nativeEvents","hasMultiAppSupport","hasCustomUrlOrRegionSupport","ModuleClass","firebase"],"sourceRoot":"../../lib","sources":["namespaced.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAASA,KAAK,QAAQ,+CAA+C;AACrE,SACEC,qBAAqB,EACrBC,cAAc,EACdC,eAAe,QACV,iDAAiD;AAGxD,SAASC,OAAO,QAAQ,cAAW;AAGnC,MAAMC,OAAO,GAAG,CAAC,CAAC;AAElB,MAAMC,SAAS,GAAG,eAAe;AACjC,MAAMC,gBAAgB,GAAG,yBAAyB;AAElD,MAAMC,2BAA2B,SAASN,cAAc,CAA0B;EAChFO,KAAKA,CAAA,EAAoB;IACvB,OAAO,IAAI,CAACC,MAAM,CAACD,KAAK,CAAC,CAAC;EAC5B;EAEAE,QAAQA,CAACC,YAAsB,EAAmB;IAChD,IAAI,CAACA,YAAY,EAAE;MACjB,OAAO,IAAI,CAACF,MAAM,CAACC,QAAQ,CAAC,KAAK,CAAC;IACpC,CAAC,MAAM;MACL,OAAO,IAAI,CAACD,MAAM,CAACC,QAAQ,CAAC,IAAI,CAAC;IACnC;EACF;EAEAE,MAAMA,CAAA,EAAkB;IACtB,OAAO,IAAI,CAACH,MAAM,CAACG,MAAM,CAAC,CAAC;EAC7B;EAEAC,UAAUA,CAAA,EAAe;IACvB,IAAId,KAAK,EAAE;MACT,OAAO,MAAM,CAAC,CAAC;IACjB;;IAEA;IACA,OAAO,MAAM,CAAC,CAAC;EACjB;AACF;;AAEA;AACA,OAAO,MAAMe,WAAW,GAAGX,OAAO;;AAElC;AACA;AACA,MAAMY,sBAAsB,GAAGf,qBAAqB,CAAC;EACnDI,OAAO;EACPD,OAAO;EACPE,SAAS;EACTC,gBAAgB;EAChBU,YAAY,EAAE,KAAK;EAAE;EACrBC,kBAAkB,EAAE,IAAI;EACxBC,2BAA2B,EAAE,KAAK;EAClCC,WAAW,EAAEZ;AACf,CAAC,CAAC;AAcF,eAAeQ,sBAAsB;;AAErC;AACA;AACA;AACA,OAAO,MAAMK,QAAQ,GACnBlB,eAAe,CAAC,CAKf","ignoreList":[]}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
/*
|
|
4
|
-
* Copyright (c) 2016-present Invertase Limited & Contributors
|
|
5
|
-
*
|
|
6
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
-
* you may not use this library except in compliance with the License.
|
|
8
|
-
* You may obtain a copy of the License at
|
|
9
|
-
*
|
|
10
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
-
*
|
|
12
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
-
* See the License for the specific language governing permissions and
|
|
16
|
-
* limitations under the License.
|
|
17
|
-
*
|
|
18
|
-
*/
|
|
19
|
-
/**
|
|
20
|
-
* Firebase Installations package for React Native.
|
|
21
|
-
*
|
|
22
|
-
* @firebase installations
|
|
23
|
-
*/
|
|
24
|
-
/**
|
|
25
|
-
* @deprecated Use the exported types directly instead.
|
|
26
|
-
* FirebaseInstallationsTypes namespace is kept for backwards compatibility.
|
|
27
|
-
*/
|
|
28
|
-
/* eslint-disable @typescript-eslint/no-namespace */
|
|
29
|
-
export let FirebaseInstallationsTypes;
|
|
30
|
-
/**
|
|
31
|
-
* Attach namespace to `firebase.` and `FirebaseApp.`.
|
|
32
|
-
*/
|
|
33
|
-
//# sourceMappingURL=namespaced.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["FirebaseInstallationsTypes"],"sourceRoot":"../../../lib","sources":["types/namespaced.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA,WACiBA,0BAA0B;AAgE3C;AACA;AACA","ignoreList":[]}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { FirebaseApp } from '@react-native-firebase/app';
|
|
2
|
-
import type { IdChangeCallbackFn, IdChangeUnsubscribeFn, Installations } from './types/installations';
|
|
3
|
-
/**
|
|
4
|
-
* Returns an instance of Installations associated with the given FirebaseApp instance.
|
|
5
|
-
*/
|
|
6
|
-
export declare function getInstallations(app?: FirebaseApp): Installations;
|
|
7
|
-
/**
|
|
8
|
-
* Deletes the Firebase Installation and all associated data.
|
|
9
|
-
*/
|
|
10
|
-
export declare function deleteInstallations(installations: Installations): Promise<void>;
|
|
11
|
-
/**
|
|
12
|
-
* Creates a Firebase Installation if there isn't one for the app and returns the Installation ID.
|
|
13
|
-
*/
|
|
14
|
-
export declare function getId(installations: Installations): Promise<string>;
|
|
15
|
-
/**
|
|
16
|
-
* Returns a Firebase Installations auth token, identifying the current Firebase Installation.
|
|
17
|
-
*/
|
|
18
|
-
export declare function getToken(installations: Installations, forceRefresh?: boolean): Promise<string>;
|
|
19
|
-
/**
|
|
20
|
-
* Throw an error since react-native-firebase does not support this method.
|
|
21
|
-
*
|
|
22
|
-
* Sets a new callback that will get called when Installation ID changes. Returns an unsubscribe function that will remove the callback when called.
|
|
23
|
-
*/
|
|
24
|
-
export declare function onIdChange(_installations: Installations, _callback: IdChangeCallbackFn): IdChangeUnsubscribeFn;
|
|
25
|
-
//# sourceMappingURL=modular.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"modular.d.ts","sourceRoot":"","sources":["../../../lib/modular.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAE9D,OAAO,KAAK,EACV,kBAAkB,EAClB,qBAAqB,EACrB,aAAa,EACd,MAAM,uBAAuB,CAAC;AAO/B;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,CAAC,EAAE,WAAW,GAAG,aAAa,CAKjE;AAED;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,aAAa,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAG/E;AAED;;GAEG;AACH,wBAAgB,KAAK,CAAC,aAAa,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAGnE;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,aAAa,EAAE,aAAa,EAAE,YAAY,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAO9F;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CACxB,cAAc,EAAE,aAAa,EAC7B,SAAS,EAAE,kBAAkB,GAC5B,qBAAqB,CAEvB"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { ReactNativeFirebase } from '@react-native-firebase/app';
|
|
2
|
-
import type { FirebaseInstallationsTypes } from './types/namespaced';
|
|
3
|
-
export declare const SDK_VERSION = "25.0.1";
|
|
4
|
-
type InstallationsNamespace = ReactNativeFirebase.FirebaseModuleWithStaticsAndApp<FirebaseInstallationsTypes.Module, FirebaseInstallationsTypes.Statics> & {
|
|
5
|
-
installations: ReactNativeFirebase.FirebaseModuleWithStaticsAndApp<FirebaseInstallationsTypes.Module, FirebaseInstallationsTypes.Statics>;
|
|
6
|
-
firebase: ReactNativeFirebase.Module;
|
|
7
|
-
app(name?: string): ReactNativeFirebase.FirebaseApp;
|
|
8
|
-
};
|
|
9
|
-
declare const _default: InstallationsNamespace;
|
|
10
|
-
export default _default;
|
|
11
|
-
export declare const firebase: ReactNativeFirebase.FirebaseNamespacedExport<"installations", FirebaseInstallationsTypes.Module, FirebaseInstallationsTypes.Statics, false>;
|
|
12
|
-
//# sourceMappingURL=namespaced.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"namespaced.d.ts","sourceRoot":"","sources":["../../../lib/namespaced.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAGtE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAmCrE,eAAO,MAAM,WAAW,WAAU,CAAC;AAenC,KAAK,sBAAsB,GAAG,mBAAmB,CAAC,+BAA+B,CAC/E,0BAA0B,CAAC,MAAM,EACjC,0BAA0B,CAAC,OAAO,CACnC,GAAG;IACF,aAAa,EAAE,mBAAmB,CAAC,+BAA+B,CAChE,0BAA0B,CAAC,MAAM,EACjC,0BAA0B,CAAC,OAAO,CACnC,CAAC;IACF,QAAQ,EAAE,mBAAmB,CAAC,MAAM,CAAC;IACrC,GAAG,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,mBAAmB,CAAC,WAAW,CAAC;CACrD,CAAC;wBAEkD,sBAAsB;AAA1E,wBAA2E;AAK3E,eAAO,MAAM,QAAQ,EACa,mBAAmB,CAAC,wBAAwB,CAC1E,eAAe,EACf,0BAA0B,CAAC,MAAM,EACjC,0BAA0B,CAAC,OAAO,EAClC,KAAK,CACN,CAAC"}
|