@react-native-firebase/in-app-messaging 25.1.0 → 26.1.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 +22 -0
- package/RNFBInAppMessaging.podspec +10 -7
- package/android/build.gradle +19 -0
- package/android/src/reactnative/java/io/invertase/firebase/fiam/{ReactNativeFirebaseFiamModule.java → NativeRNFBTurboFiam.java} +17 -18
- package/android/src/reactnative/java/io/invertase/firebase/fiam/ReactNativeFirebaseFiamPackage.java +1 -1
- package/android/src/reactnative/java/io/invertase/firebase/fiam/generated/java/com/facebook/fbreact/specs/NativeRNFBTurboFiamSpec.java +79 -0
- package/android/src/reactnative/java/io/invertase/firebase/fiam/generated/jni/CMakeLists.txt +36 -0
- package/android/src/reactnative/java/io/invertase/firebase/fiam/generated/jni/RNFBInAppMessagingTurboModules-generated.cpp +50 -0
- package/android/src/reactnative/java/io/invertase/firebase/fiam/generated/jni/RNFBInAppMessagingTurboModules.h +31 -0
- package/android/src/reactnative/java/io/invertase/firebase/fiam/generated/jni/react/renderer/components/RNFBInAppMessagingTurboModules/RNFBInAppMessagingTurboModulesJSI-generated.cpp +47 -0
- package/android/src/reactnative/java/io/invertase/firebase/fiam/generated/jni/react/renderer/components/RNFBInAppMessagingTurboModules/RNFBInAppMessagingTurboModulesJSI.h +98 -0
- package/dist/module/index.js +113 -3
- package/dist/module/index.js.map +1 -1
- package/dist/module/version.js +1 -1
- package/dist/module/web/RNFBFiamModule.js +34 -0
- package/dist/module/web/RNFBFiamModule.js.map +1 -0
- package/dist/typescript/lib/index.d.ts +46 -4
- package/dist/typescript/lib/index.d.ts.map +1 -1
- package/dist/typescript/lib/types/internal.d.ts +1 -8
- package/dist/typescript/lib/types/internal.d.ts.map +1 -1
- package/dist/typescript/lib/version.d.ts +1 -1
- package/dist/typescript/lib/web/RNFBFiamModule.d.ts +4 -0
- package/dist/typescript/lib/web/RNFBFiamModule.d.ts.map +1 -0
- package/ios/RNFBFiam/RNFBFiamHelper.h +47 -0
- package/ios/RNFBFiam/RNFBFiamHelper.m +82 -0
- package/ios/RNFBFiam/RNFBFiamModule.h +2 -3
- package/ios/RNFBFiam/RNFBFiamModule.mm +75 -0
- package/ios/RNFBFiam.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/RNFBInAppMessagingTurboModules/RNFBInAppMessagingTurboModules-generated.mm +60 -0
- package/ios/generated/RNFBInAppMessagingTurboModules/RNFBInAppMessagingTurboModules.h +112 -0
- package/ios/generated/RNFBInAppMessagingTurboModulesJSI-generated.cpp +47 -0
- package/ios/generated/RNFBInAppMessagingTurboModulesJSI.h +98 -0
- package/ios/generated/ReactAppDependencyProvider.podspec +34 -0
- package/lib/index.ts +141 -5
- package/lib/types/internal.ts +1 -16
- package/lib/version.ts +1 -1
- package/lib/web/RNFBFiamModule.ts +34 -0
- package/package.json +23 -5
- package/react-native.config.js +10 -0
- package/specs/NativeRNFBTurboFiam.ts +15 -0
- package/tsconfig.json +4 -0
- package/typedoc.json +1 -1
- package/dist/module/modular.js +0 -80
- package/dist/module/modular.js.map +0 -1
- package/dist/module/namespaced.js +0 -78
- package/dist/module/namespaced.js.map +0 -1
- package/dist/module/types/namespaced.js +0 -62
- package/dist/module/types/namespaced.js.map +0 -1
- package/dist/typescript/lib/modular.d.ts +0 -36
- 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 -107
- package/dist/typescript/lib/types/namespaced.d.ts.map +0 -1
- package/ios/RNFBFiam/RNFBFiamModule.m +0 -71
- package/lib/modular.ts +0 -103
- package/lib/namespaced.ts +0 -117
- package/lib/types/namespaced.ts +0 -137
package/lib/namespaced.ts
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2016-present Invertase Limited & Contributors
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this library except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
import { isBoolean, isString } from '@react-native-firebase/app/dist/module/common';
|
|
19
|
-
import {
|
|
20
|
-
createModuleNamespace,
|
|
21
|
-
FirebaseModule,
|
|
22
|
-
getFirebaseRoot,
|
|
23
|
-
} from '@react-native-firebase/app/dist/module/internal';
|
|
24
|
-
import type { ReactNativeFirebase } from '@react-native-firebase/app';
|
|
25
|
-
|
|
26
|
-
import './types/internal';
|
|
27
|
-
import type { FirebaseInAppMessagingTypes } from './types/namespaced';
|
|
28
|
-
import { version } from './version';
|
|
29
|
-
|
|
30
|
-
const statics = {};
|
|
31
|
-
|
|
32
|
-
const namespace = 'inAppMessaging';
|
|
33
|
-
|
|
34
|
-
const nativeModuleName = 'RNFBFiamModule';
|
|
35
|
-
|
|
36
|
-
class FirebaseFiamModule extends FirebaseModule<typeof nativeModuleName> {
|
|
37
|
-
private _isMessagesDisplaySuppressed: boolean;
|
|
38
|
-
private _isAutomaticDataCollectionEnabled: boolean;
|
|
39
|
-
|
|
40
|
-
constructor(...args: ConstructorParameters<typeof FirebaseModule>) {
|
|
41
|
-
super(...args);
|
|
42
|
-
this._isMessagesDisplaySuppressed = this.native.isMessagesDisplaySuppressed;
|
|
43
|
-
this._isAutomaticDataCollectionEnabled = this.native.isAutomaticDataCollectionEnabled;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
get isMessagesDisplaySuppressed(): boolean {
|
|
47
|
-
return this._isMessagesDisplaySuppressed;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
get isAutomaticDataCollectionEnabled(): boolean {
|
|
51
|
-
return this._isAutomaticDataCollectionEnabled;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
setMessagesDisplaySuppressed(enabled: boolean): Promise<null> {
|
|
55
|
-
if (!isBoolean(enabled)) {
|
|
56
|
-
throw new Error(
|
|
57
|
-
"firebase.inAppMessaging().setMessagesDisplaySuppressed(*) 'enabled' must be a boolean.",
|
|
58
|
-
);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
this._isMessagesDisplaySuppressed = enabled;
|
|
62
|
-
return this.native.setMessagesDisplaySuppressed(enabled);
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
setAutomaticDataCollectionEnabled(enabled: boolean): Promise<null> {
|
|
66
|
-
if (!isBoolean(enabled)) {
|
|
67
|
-
throw new Error(
|
|
68
|
-
"firebase.inAppMessaging().setAutomaticDataCollectionEnabled(*) 'enabled' must be a boolean.",
|
|
69
|
-
);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
this._isAutomaticDataCollectionEnabled = enabled;
|
|
73
|
-
return this.native.setAutomaticDataCollectionEnabled(enabled);
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
triggerEvent(eventId: string): Promise<null> {
|
|
77
|
-
if (!isString(eventId)) {
|
|
78
|
-
throw new Error("firebase.inAppMessaging().triggerEvent(*) 'eventId' must be a string.");
|
|
79
|
-
}
|
|
80
|
-
return this.native.triggerEvent(eventId);
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
type InAppMessagingNamespace = ReactNativeFirebase.FirebaseModuleWithStaticsAndApp<
|
|
85
|
-
FirebaseInAppMessagingTypes.Module,
|
|
86
|
-
FirebaseInAppMessagingTypes.Statics
|
|
87
|
-
> & {
|
|
88
|
-
firebase: ReactNativeFirebase.Module;
|
|
89
|
-
app(name?: string): ReactNativeFirebase.FirebaseApp;
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
// import { SDK_VERSION } from '@react-native-firebase/in-app-messaging';
|
|
93
|
-
export const SDK_VERSION = version;
|
|
94
|
-
|
|
95
|
-
const defaultExport = createModuleNamespace({
|
|
96
|
-
statics,
|
|
97
|
-
version,
|
|
98
|
-
namespace,
|
|
99
|
-
nativeModuleName,
|
|
100
|
-
nativeEvents: false,
|
|
101
|
-
hasMultiAppSupport: false,
|
|
102
|
-
hasCustomUrlOrRegionSupport: false,
|
|
103
|
-
ModuleClass: FirebaseFiamModule,
|
|
104
|
-
}) as unknown as InAppMessagingNamespace;
|
|
105
|
-
|
|
106
|
-
export default defaultExport;
|
|
107
|
-
|
|
108
|
-
// import inAppMessaging, { firebase } from '@react-native-firebase/in-app-messaging';
|
|
109
|
-
// inAppMessaging().X(...);
|
|
110
|
-
// firebase.inAppMessaging().X(...);
|
|
111
|
-
export const firebase =
|
|
112
|
-
getFirebaseRoot() as unknown as ReactNativeFirebase.FirebaseNamespacedExport<
|
|
113
|
-
'inAppMessaging',
|
|
114
|
-
FirebaseInAppMessagingTypes.Module,
|
|
115
|
-
FirebaseInAppMessagingTypes.Statics,
|
|
116
|
-
false
|
|
117
|
-
>;
|
package/lib/types/namespaced.ts
DELETED
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) 2016-present Invertase Limited & Contributors
|
|
3
|
-
*
|
|
4
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
-
* you may not use this library except in compliance with the License.
|
|
6
|
-
* You may obtain a copy of the License at
|
|
7
|
-
*
|
|
8
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
-
*
|
|
10
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
-
* See the License for the specific language governing permissions and
|
|
14
|
-
* limitations under the License.
|
|
15
|
-
*
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
import type { ReactNativeFirebase } from '@react-native-firebase/app';
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Firebase In-App Messaging package for React Native.
|
|
22
|
-
*
|
|
23
|
-
* #### Example 1
|
|
24
|
-
*
|
|
25
|
-
* Access the firebase export from the `inAppMessaging` package:
|
|
26
|
-
*
|
|
27
|
-
* ```js
|
|
28
|
-
* import { firebase } from '@react-native-firebase/in-app-messaging';
|
|
29
|
-
*
|
|
30
|
-
* // firebase.inAppMessaging().X
|
|
31
|
-
* ```
|
|
32
|
-
*
|
|
33
|
-
* #### Example 2
|
|
34
|
-
*
|
|
35
|
-
* Using the default export from the `in-app-messaging` package:
|
|
36
|
-
*
|
|
37
|
-
* ```js
|
|
38
|
-
* import inAppMessaging from '@react-native-firebase/in-app-messaging';
|
|
39
|
-
*
|
|
40
|
-
* // inAppMessaging().X
|
|
41
|
-
* ```
|
|
42
|
-
*
|
|
43
|
-
* #### Example 3
|
|
44
|
-
*
|
|
45
|
-
* Using the default export from the `app` package:
|
|
46
|
-
*
|
|
47
|
-
* ```js
|
|
48
|
-
* import firebase from '@react-native-firebase/app';
|
|
49
|
-
* import '@react-native-firebase/in-app-messaging';
|
|
50
|
-
*
|
|
51
|
-
* // firebase.inAppMessaging().X
|
|
52
|
-
* ```
|
|
53
|
-
*
|
|
54
|
-
* @firebase in-app-messaging
|
|
55
|
-
*/
|
|
56
|
-
/**
|
|
57
|
-
* @deprecated Use the exported types directly instead.
|
|
58
|
-
* FirebaseInAppMessagingTypes namespace is kept for backwards compatibility.
|
|
59
|
-
*/
|
|
60
|
-
/* eslint-disable @typescript-eslint/no-namespace */
|
|
61
|
-
export namespace FirebaseInAppMessagingTypes {
|
|
62
|
-
/**
|
|
63
|
-
* @deprecated Use the exported types directly instead. FirebaseInAppMessagingTypes namespace is kept for backwards compatibility.
|
|
64
|
-
*/
|
|
65
|
-
type FirebaseModule = ReactNativeFirebase.FirebaseModule;
|
|
66
|
-
|
|
67
|
-
/**
|
|
68
|
-
* @deprecated Use the default export statics instead.
|
|
69
|
-
*/
|
|
70
|
-
export interface Statics {
|
|
71
|
-
/** @deprecated Use the default export statics instead. */
|
|
72
|
-
SDK_VERSION: string;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* @deprecated Use the exported `InAppMessaging` type instead.
|
|
77
|
-
*/
|
|
78
|
-
export interface Module extends FirebaseModule {
|
|
79
|
-
/**
|
|
80
|
-
* @deprecated Use the exported `InAppMessaging` type instead.
|
|
81
|
-
*
|
|
82
|
-
* The current `FirebaseApp` instance for this Firebase service.
|
|
83
|
-
*/
|
|
84
|
-
app: ReactNativeFirebase.FirebaseApp;
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* @deprecated Use the exported `InAppMessaging` type instead.
|
|
88
|
-
*
|
|
89
|
-
* Determines whether messages are suppressed or not.
|
|
90
|
-
*/
|
|
91
|
-
isMessagesDisplaySuppressed: boolean;
|
|
92
|
-
|
|
93
|
-
/**
|
|
94
|
-
* @deprecated Use the exported `InAppMessaging` type instead.
|
|
95
|
-
*
|
|
96
|
-
* Determines whether automatic data collection is enabled or not.
|
|
97
|
-
*/
|
|
98
|
-
isAutomaticDataCollectionEnabled: boolean;
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* @deprecated Use the exported `InAppMessaging` type instead.
|
|
102
|
-
*
|
|
103
|
-
* Enable or disable suppression of Firebase In App Messaging messages.
|
|
104
|
-
*/
|
|
105
|
-
setMessagesDisplaySuppressed(enabled: boolean): Promise<null>;
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* @deprecated Use the exported `InAppMessaging` type instead.
|
|
109
|
-
*
|
|
110
|
-
* Enable or disable automatic data collection for Firebase In-App Messaging.
|
|
111
|
-
*/
|
|
112
|
-
setAutomaticDataCollectionEnabled(enabled: boolean): Promise<null>;
|
|
113
|
-
|
|
114
|
-
/**
|
|
115
|
-
* @deprecated Use the exported `InAppMessaging` type instead.
|
|
116
|
-
*
|
|
117
|
-
* Trigger in-app messages programmatically.
|
|
118
|
-
*/
|
|
119
|
-
triggerEvent(eventId: string): Promise<null>;
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
declare module '@react-native-firebase/app' {
|
|
124
|
-
namespace ReactNativeFirebase {
|
|
125
|
-
interface Module {
|
|
126
|
-
inAppMessaging: FirebaseModuleWithStaticsAndApp<
|
|
127
|
-
FirebaseInAppMessagingTypes.Module,
|
|
128
|
-
FirebaseInAppMessagingTypes.Statics
|
|
129
|
-
>;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
interface FirebaseApp {
|
|
133
|
-
inAppMessaging(): FirebaseInAppMessagingTypes.Module;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
/* eslint-enable @typescript-eslint/no-namespace */
|