@react-native-firebase/in-app-messaging 24.1.0 → 25.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 +8 -0
- package/dist/module/index.js +23 -0
- package/dist/module/index.js.map +1 -0
- package/dist/module/modular.js +80 -0
- package/dist/module/modular.js.map +1 -0
- package/{lib/index.js → dist/module/namespaced.js} +11 -31
- package/dist/module/namespaced.js.map +1 -0
- package/dist/module/package.json +1 -0
- package/dist/module/types/in-app-messaging.js +4 -0
- package/dist/module/types/in-app-messaging.js.map +1 -0
- package/dist/module/types/internal.js +4 -0
- package/dist/module/types/internal.js.map +1 -0
- package/dist/module/types/namespaced.js +62 -0
- package/dist/module/types/namespaced.js.map +1 -0
- package/dist/module/version.js +5 -0
- package/dist/module/version.js.map +1 -0
- package/dist/typescript/lib/index.d.ts +6 -0
- package/dist/typescript/lib/index.d.ts.map +1 -0
- package/dist/typescript/lib/modular.d.ts +36 -0
- package/dist/typescript/lib/modular.d.ts.map +1 -0
- package/dist/typescript/lib/namespaced.d.ts +12 -0
- package/dist/typescript/lib/namespaced.d.ts.map +1 -0
- package/dist/typescript/lib/types/in-app-messaging.d.ts +33 -0
- package/dist/typescript/lib/types/in-app-messaging.d.ts.map +1 -0
- package/dist/typescript/lib/types/internal.d.ts +27 -0
- package/dist/typescript/lib/types/internal.d.ts.map +1 -0
- package/dist/typescript/lib/types/namespaced.d.ts +107 -0
- package/dist/typescript/lib/types/namespaced.d.ts.map +1 -0
- package/dist/typescript/lib/version.d.ts +2 -0
- package/dist/typescript/lib/version.d.ts.map +1 -0
- package/dist/typescript/package.json +1 -0
- package/lib/index.ts +25 -0
- package/lib/modular.ts +101 -0
- package/lib/namespaced.ts +117 -0
- package/lib/types/in-app-messaging.ts +55 -0
- package/lib/types/internal.ts +54 -0
- package/lib/types/namespaced.ts +137 -0
- package/lib/version.ts +2 -0
- package/package.json +42 -8
- package/tsconfig.json +16 -0
- package/typedoc.json +1 -2
- package/lib/index.d.ts +0 -194
- package/lib/modular/index.d.ts +0 -89
- package/lib/modular/index.js +0 -57
- package/lib/version.js +0 -2
package/lib/modular.ts
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
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 { getApp } from '@react-native-firebase/app';
|
|
19
|
+
import {
|
|
20
|
+
MODULAR_DEPRECATION_ARG,
|
|
21
|
+
withModularFlag,
|
|
22
|
+
} from '@react-native-firebase/app/dist/module/common';
|
|
23
|
+
import type { InAppMessaging } from './types/in-app-messaging';
|
|
24
|
+
import type { InAppMessagingWithDeprecationArg } from './types/internal';
|
|
25
|
+
|
|
26
|
+
function withModularDeprecationArg(inAppMessaging: InAppMessaging): InAppMessagingWithDeprecationArg {
|
|
27
|
+
return inAppMessaging as InAppMessagingWithDeprecationArg;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Returns the {@link InAppMessaging} instance for the default app.
|
|
32
|
+
*/
|
|
33
|
+
export function getInAppMessaging(): InAppMessaging {
|
|
34
|
+
return getApp().inAppMessaging();
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Determines whether messages are suppressed or not.
|
|
39
|
+
*/
|
|
40
|
+
export function isMessagesDisplaySuppressed(inAppMessaging: InAppMessaging): boolean {
|
|
41
|
+
return withModularFlag(() => inAppMessaging.isMessagesDisplaySuppressed);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Enable or disable suppression of Firebase In App Messaging messages.
|
|
46
|
+
*
|
|
47
|
+
* When enabled, no in app messages will be rendered until either you disable suppression, or the app
|
|
48
|
+
* restarts. This state is not persisted between app restarts.
|
|
49
|
+
*/
|
|
50
|
+
export function setMessagesDisplaySuppressed(
|
|
51
|
+
inAppMessaging: InAppMessaging,
|
|
52
|
+
enabled: boolean,
|
|
53
|
+
): Promise<null> {
|
|
54
|
+
const internalInAppMessaging = withModularDeprecationArg(inAppMessaging);
|
|
55
|
+
return internalInAppMessaging.setMessagesDisplaySuppressed.call(
|
|
56
|
+
internalInAppMessaging,
|
|
57
|
+
enabled,
|
|
58
|
+
MODULAR_DEPRECATION_ARG,
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Determines whether automatic data collection is enabled or not.
|
|
64
|
+
*/
|
|
65
|
+
export function isAutomaticDataCollectionEnabled(inAppMessaging: InAppMessaging): boolean {
|
|
66
|
+
return withModularFlag(() => inAppMessaging.isAutomaticDataCollectionEnabled);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Enable or disable automatic data collection for Firebase In-App Messaging.
|
|
71
|
+
*
|
|
72
|
+
* When enabled, generates a registration token on app startup if there is no valid one and
|
|
73
|
+
* generates a new token when it is deleted (which prevents `deleteInstanceId()` from stopping the
|
|
74
|
+
* periodic sending of data).
|
|
75
|
+
*
|
|
76
|
+
* This setting is persisted across app restarts and overrides the setting specified in your
|
|
77
|
+
* manifest/plist file.
|
|
78
|
+
*/
|
|
79
|
+
export function setAutomaticDataCollectionEnabled(
|
|
80
|
+
inAppMessaging: InAppMessaging,
|
|
81
|
+
enabled: boolean,
|
|
82
|
+
): Promise<null> {
|
|
83
|
+
const internalInAppMessaging = withModularDeprecationArg(inAppMessaging);
|
|
84
|
+
return internalInAppMessaging.setAutomaticDataCollectionEnabled.call(
|
|
85
|
+
internalInAppMessaging,
|
|
86
|
+
enabled,
|
|
87
|
+
MODULAR_DEPRECATION_ARG,
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Trigger in-app messages programmatically.
|
|
93
|
+
*/
|
|
94
|
+
export function triggerEvent(inAppMessaging: InAppMessaging, eventId: string): Promise<null> {
|
|
95
|
+
const internalInAppMessaging = withModularDeprecationArg(inAppMessaging);
|
|
96
|
+
return internalInAppMessaging.triggerEvent.call(
|
|
97
|
+
internalInAppMessaging,
|
|
98
|
+
eventId,
|
|
99
|
+
MODULAR_DEPRECATION_ARG,
|
|
100
|
+
);
|
|
101
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
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
|
+
>;
|
|
@@ -0,0 +1,55 @@
|
|
|
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 { FirebaseApp } from '@react-native-firebase/app';
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Firebase In-App Messaging service instance for the modular API.
|
|
22
|
+
*
|
|
23
|
+
* Current Firebase JS SDK releases do not ship a `firebase/in-app-messaging` modular entry point;
|
|
24
|
+
* this interface follows the same modular service-instance pattern used elsewhere in React Native
|
|
25
|
+
* Firebase.
|
|
26
|
+
*/
|
|
27
|
+
export interface InAppMessaging {
|
|
28
|
+
/** The FirebaseApp this module is associated with. */
|
|
29
|
+
app: FirebaseApp;
|
|
30
|
+
|
|
31
|
+
/** Whether Firebase In-App Messaging message rendering is currently suppressed. */
|
|
32
|
+
isMessagesDisplaySuppressed: boolean;
|
|
33
|
+
|
|
34
|
+
/** Whether automatic data collection is enabled for Firebase In-App Messaging. */
|
|
35
|
+
isAutomaticDataCollectionEnabled: boolean;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Enable or disable suppression of Firebase In-App Messaging messages.
|
|
39
|
+
*
|
|
40
|
+
* When enabled, no in-app messages will be rendered until either suppression is disabled or the
|
|
41
|
+
* app restarts. This state is not persisted between app restarts.
|
|
42
|
+
*/
|
|
43
|
+
setMessagesDisplaySuppressed(enabled: boolean): Promise<null>;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Enable or disable automatic data collection for Firebase In-App Messaging.
|
|
47
|
+
*
|
|
48
|
+
* When enabled, generates a registration token on app startup if there is no valid one and
|
|
49
|
+
* generates a new token when it is deleted.
|
|
50
|
+
*/
|
|
51
|
+
setAutomaticDataCollectionEnabled(enabled: boolean): Promise<null>;
|
|
52
|
+
|
|
53
|
+
/** Trigger in-app messages programmatically for the given event id. */
|
|
54
|
+
triggerEvent(eventId: string): Promise<null>;
|
|
55
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
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 { InAppMessaging } from './in-app-messaging';
|
|
19
|
+
|
|
20
|
+
/** Optional final argument passed by modular API wrappers (MODULAR_DEPRECATION_ARG). */
|
|
21
|
+
export type InAppMessagingModularDeprecationArg = string;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Wrapped native module contract for `RNFBFiamModule`.
|
|
25
|
+
*/
|
|
26
|
+
export interface RNFBFiamModule {
|
|
27
|
+
isMessagesDisplaySuppressed: boolean;
|
|
28
|
+
isAutomaticDataCollectionEnabled: boolean;
|
|
29
|
+
setMessagesDisplaySuppressed(enabled: boolean): Promise<null>;
|
|
30
|
+
setAutomaticDataCollectionEnabled(enabled: boolean): Promise<null>;
|
|
31
|
+
triggerEvent(eventId: string): Promise<null>;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
declare module '@react-native-firebase/app/dist/module/internal/NativeModules' {
|
|
35
|
+
interface ReactNativeFirebaseNativeModules {
|
|
36
|
+
RNFBFiamModule: RNFBFiamModule;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export interface InAppMessagingInternal extends InAppMessaging {
|
|
41
|
+
readonly native: RNFBFiamModule;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export type InAppMessagingWithDeprecationArg = InAppMessagingInternal & {
|
|
45
|
+
setMessagesDisplaySuppressed(
|
|
46
|
+
enabled: boolean,
|
|
47
|
+
_depArg: InAppMessagingModularDeprecationArg,
|
|
48
|
+
): Promise<null>;
|
|
49
|
+
setAutomaticDataCollectionEnabled(
|
|
50
|
+
enabled: boolean,
|
|
51
|
+
_depArg: InAppMessagingModularDeprecationArg,
|
|
52
|
+
): Promise<null>;
|
|
53
|
+
triggerEvent(eventId: string, _depArg: InAppMessagingModularDeprecationArg): Promise<null>;
|
|
54
|
+
};
|
|
@@ -0,0 +1,137 @@
|
|
|
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 */
|
package/lib/version.ts
ADDED
package/package.json
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-native-firebase/in-app-messaging",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "25.0.0",
|
|
4
4
|
"author": "Invertase <oss@invertase.io> (http://invertase.io)",
|
|
5
5
|
"description": "React Native Firebase - Firebase In-App Messaging helps you engage your app's active users by sending them targeted, contextual messages that encourage them to use key app features. React Native Firebase provides support for both native Android & iOS integration with a simple JavaScript API.",
|
|
6
|
-
"main": "
|
|
7
|
-
"types": "lib/index.d.ts",
|
|
6
|
+
"main": "./dist/module/index.js",
|
|
7
|
+
"types": "./dist/typescript/lib/index.d.ts",
|
|
8
8
|
"scripts": {
|
|
9
|
-
"build": "genversion --semi lib/version.
|
|
9
|
+
"build": "genversion --esm --semi lib/version.ts",
|
|
10
10
|
"build:clean": "rimraf android/build && rimraf ios/build",
|
|
11
|
-
"
|
|
11
|
+
"compile": "bob build",
|
|
12
|
+
"prepare": "yarn run build && yarn compile"
|
|
12
13
|
},
|
|
13
14
|
"repository": {
|
|
14
15
|
"type": "git",
|
|
@@ -27,12 +28,45 @@
|
|
|
27
28
|
"inAppMessaging"
|
|
28
29
|
],
|
|
29
30
|
"peerDependencies": {
|
|
30
|
-
"@react-native-firebase/analytics": "
|
|
31
|
-
"@react-native-firebase/app": "
|
|
31
|
+
"@react-native-firebase/analytics": "25.0.0",
|
|
32
|
+
"@react-native-firebase/app": "25.0.0"
|
|
32
33
|
},
|
|
33
34
|
"publishConfig": {
|
|
34
35
|
"access": "public",
|
|
35
36
|
"provenance": true
|
|
36
37
|
},
|
|
37
|
-
"
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"react-native-builder-bob": "^0.41.0"
|
|
40
|
+
},
|
|
41
|
+
"exports": {
|
|
42
|
+
".": {
|
|
43
|
+
"source": "./lib/index.ts",
|
|
44
|
+
"types": "./dist/typescript/lib/index.d.ts",
|
|
45
|
+
"default": "./dist/module/index.js"
|
|
46
|
+
},
|
|
47
|
+
"./package.json": "./package.json"
|
|
48
|
+
},
|
|
49
|
+
"react-native-builder-bob": {
|
|
50
|
+
"source": "lib",
|
|
51
|
+
"output": "dist",
|
|
52
|
+
"targets": [
|
|
53
|
+
[
|
|
54
|
+
"module",
|
|
55
|
+
{
|
|
56
|
+
"esm": true
|
|
57
|
+
}
|
|
58
|
+
],
|
|
59
|
+
[
|
|
60
|
+
"typescript",
|
|
61
|
+
{
|
|
62
|
+
"tsc": "../../node_modules/.bin/tsc"
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
]
|
|
66
|
+
},
|
|
67
|
+
"eslintIgnore": [
|
|
68
|
+
"node_modules/",
|
|
69
|
+
"dist/"
|
|
70
|
+
],
|
|
71
|
+
"gitHead": "eac5bf5f3c80b158bf85b33789e4b64bfd16bbe1"
|
|
38
72
|
}
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../tsconfig.packages.base.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"rootDir": ".",
|
|
5
|
+
"paths": {
|
|
6
|
+
"@react-native-firebase/app/dist/module/common": ["../app/dist/typescript/lib/common"],
|
|
7
|
+
"@react-native-firebase/app/dist/module/internal": ["../app/dist/typescript/lib/internal"],
|
|
8
|
+
"@react-native-firebase/app/dist/module/internal/NativeModules": [
|
|
9
|
+
"../app/dist/typescript/lib/internal/NativeModules"
|
|
10
|
+
],
|
|
11
|
+
"@react-native-firebase/app": ["../app/dist/typescript/lib"]
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"include": ["lib/**/*"],
|
|
15
|
+
"exclude": ["node_modules", "dist", "__tests__", "**/*.test.ts"]
|
|
16
|
+
}
|
package/typedoc.json
CHANGED