@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.
Files changed (45) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/module/index.js +23 -0
  3. package/dist/module/index.js.map +1 -0
  4. package/dist/module/modular.js +80 -0
  5. package/dist/module/modular.js.map +1 -0
  6. package/{lib/index.js → dist/module/namespaced.js} +11 -31
  7. package/dist/module/namespaced.js.map +1 -0
  8. package/dist/module/package.json +1 -0
  9. package/dist/module/types/in-app-messaging.js +4 -0
  10. package/dist/module/types/in-app-messaging.js.map +1 -0
  11. package/dist/module/types/internal.js +4 -0
  12. package/dist/module/types/internal.js.map +1 -0
  13. package/dist/module/types/namespaced.js +62 -0
  14. package/dist/module/types/namespaced.js.map +1 -0
  15. package/dist/module/version.js +5 -0
  16. package/dist/module/version.js.map +1 -0
  17. package/dist/typescript/lib/index.d.ts +6 -0
  18. package/dist/typescript/lib/index.d.ts.map +1 -0
  19. package/dist/typescript/lib/modular.d.ts +36 -0
  20. package/dist/typescript/lib/modular.d.ts.map +1 -0
  21. package/dist/typescript/lib/namespaced.d.ts +12 -0
  22. package/dist/typescript/lib/namespaced.d.ts.map +1 -0
  23. package/dist/typescript/lib/types/in-app-messaging.d.ts +33 -0
  24. package/dist/typescript/lib/types/in-app-messaging.d.ts.map +1 -0
  25. package/dist/typescript/lib/types/internal.d.ts +27 -0
  26. package/dist/typescript/lib/types/internal.d.ts.map +1 -0
  27. package/dist/typescript/lib/types/namespaced.d.ts +107 -0
  28. package/dist/typescript/lib/types/namespaced.d.ts.map +1 -0
  29. package/dist/typescript/lib/version.d.ts +2 -0
  30. package/dist/typescript/lib/version.d.ts.map +1 -0
  31. package/dist/typescript/package.json +1 -0
  32. package/lib/index.ts +25 -0
  33. package/lib/modular.ts +101 -0
  34. package/lib/namespaced.ts +117 -0
  35. package/lib/types/in-app-messaging.ts +55 -0
  36. package/lib/types/internal.ts +54 -0
  37. package/lib/types/namespaced.ts +137 -0
  38. package/lib/version.ts +2 -0
  39. package/package.json +42 -8
  40. package/tsconfig.json +16 -0
  41. package/typedoc.json +1 -2
  42. package/lib/index.d.ts +0 -194
  43. package/lib/modular/index.d.ts +0 -89
  44. package/lib/modular/index.js +0 -57
  45. package/lib/version.js +0 -2
package/lib/index.d.ts DELETED
@@ -1,194 +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 { 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
- export namespace FirebaseInAppMessagingTypes {
57
- import FirebaseModule = ReactNativeFirebase.FirebaseModule;
58
-
59
- export interface Statics {
60
- SDK_VERSION: string;
61
- }
62
-
63
- /**
64
- * The Firebase In-App Messaging service interface.
65
- *
66
- * > This module is available for the default app only.
67
- *
68
- * #### Example
69
- *
70
- * Get the In-App Messaging service for the default app:
71
- *
72
- * ```js
73
- * const defaultAppInAppMessaging = firebase.inAppMessaging();
74
- * ```
75
- */
76
- export class Module extends FirebaseModule {
77
- /**
78
- * The current `FirebaseApp` instance for this Firebase service.
79
- */
80
- app: ReactNativeFirebase.FirebaseApp;
81
-
82
- /**
83
- * Determines whether messages are suppressed or not.
84
- *
85
- * #### Example
86
- *
87
- * ```js
88
- * const isSuppressed = firebase.inAppMessaging().isMessagesDisplaySuppressed;
89
- * ```
90
- */
91
- isMessagesDisplaySuppressed: boolean;
92
-
93
- /**
94
- * Enable or disable suppression of Firebase In App Messaging messages.
95
- *
96
- * When enabled, no in app messages will be rendered until either you disable suppression, or the app restarts.
97
- * This state is not persisted between app restarts.
98
- *
99
- * #### Example
100
- *
101
- * ```js
102
- * // Suppress messages
103
- * await firebase.inAppMessaging().setMessagesDisplaySuppressed(true);
104
- * ```
105
- *
106
- * @param enabled Whether messages should be suppressed.
107
- */
108
- setMessagesDisplaySuppressed(enabled: boolean): Promise<null>;
109
-
110
- /**
111
- * Determines whether automatic data collection is enabled or not.
112
- *
113
- * #### Example
114
- *
115
- * ```js
116
- * const isDataCollectionEnabled = firebase.inAppMessaging().isAutomaticDataCollectionEnabled;
117
- * ```
118
- */
119
- isAutomaticDataCollectionEnabled: boolean;
120
-
121
- /**
122
- * Enable or disable automatic data collection for Firebase In-App Messaging.
123
- *
124
- * When enabled, generates a registration token on app startup if there is no valid one and generates a new token
125
- * when it is deleted (which prevents `deleteInstanceId()` from stopping the periodic sending of data).
126
- *
127
- * This setting is persisted across app restarts and overrides the setting specified in your manifest/plist file.
128
- *
129
- * #### Example
130
- *
131
- * ```js
132
- * // Disable data collection
133
- * firebase.inAppMessaging().setAutomaticDataCollectionEnabled(false);
134
- * ```
135
- *
136
- * @param enabled Whether automatic data collection is enabled.
137
- */
138
- setAutomaticDataCollectionEnabled(enabled: boolean): Promise<null>;
139
-
140
- /**
141
- * Trigger in-app messages programmatically
142
- *
143
- * #### Example
144
- *
145
- * ```js
146
- * // Suppress messages
147
- * await firebase.inAppMessaging().triggerEvent("exampleTrigger");
148
- * ```
149
- *
150
- * @param eventId The id of the event.
151
- */
152
- triggerEvent(eventId: string): Promise<null>;
153
- }
154
- }
155
-
156
- type InAppMessagingNamespace = ReactNativeFirebase.FirebaseModuleWithStatics<
157
- FirebaseInAppMessagingTypes.Module,
158
- FirebaseInAppMessagingTypes.Statics
159
- > & {
160
- firebase: ReactNativeFirebase.Module;
161
- app(name?: string): ReactNativeFirebase.FirebaseApp;
162
- };
163
-
164
- declare const defaultExport: InAppMessagingNamespace;
165
-
166
- export const firebase: ReactNativeFirebase.Module & {
167
- inAppMessaging: typeof defaultExport;
168
- app(
169
- name?: string,
170
- ): ReactNativeFirebase.FirebaseApp & { inAppMessaging(): FirebaseInAppMessagingTypes.Module };
171
- };
172
-
173
- export default defaultExport;
174
-
175
- export * from './modular';
176
-
177
- /**
178
- * Attach namespace to `firebase.` and `FirebaseApp.`.
179
- */
180
- declare module '@react-native-firebase/app' {
181
- namespace ReactNativeFirebase {
182
- import FirebaseModuleWithStatics = ReactNativeFirebase.FirebaseModuleWithStatics;
183
- interface Module {
184
- inAppMessaging: FirebaseModuleWithStatics<
185
- FirebaseInAppMessagingTypes.Module,
186
- FirebaseInAppMessagingTypes.Statics
187
- >;
188
- }
189
-
190
- interface FirebaseApp {
191
- inAppMessaging(): FirebaseInAppMessagingTypes.Module;
192
- }
193
- }
194
- }
@@ -1,89 +0,0 @@
1
- import { FirebaseInAppMessagingTypes } from '..';
2
-
3
- type FirebaseInAppMessaging = FirebaseInAppMessagingTypes.Module;
4
-
5
- export declare function getInAppMessaging(): FirebaseInAppMessaging;
6
-
7
- /**
8
- * Determines whether messages are suppressed or not.
9
- *
10
- * #### Example
11
- *
12
- * ```js
13
- * const inAppMessaging = getInAppMessaging();
14
- * const isSuppressed = isMessagesDisplaySuppressed(inAppMessaging);
15
- * ```
16
- */
17
- export declare function isMessagesDisplaySuppressed(
18
- inAppMessaging: FirebaseInAppMessaging,
19
- ): boolean;
20
-
21
- /**
22
- * Enable or disable suppression of Firebase In App Messaging messages.
23
- *
24
- * When enabled, no in app messages will be rendered until either you disable suppression, or the app restarts.
25
- * This state is not persisted between app restarts.
26
- *
27
- * #### Example
28
- *
29
- * ```js
30
- * // Suppress messages
31
- * const inAppMessaging = getInAppMessaging();
32
- * await setMessagesDisplaySuppressed(inAppMessaging, true);
33
- * ```
34
- */
35
- export declare function setMessagesDisplaySuppressed(
36
- inAppMessaging: FirebaseInAppMessaging,
37
- enabled: boolean,
38
- ): Promise<null>;
39
-
40
- /**
41
- * Determines whether automatic data collection is enabled or not.
42
- *
43
- * #### Example
44
- *
45
- * ```js
46
- * const inAppMessaging = getInAppMessaging();
47
- * const isDataCollectionEnabled = isAutomaticDataCollectionEnabled(inAppMessaging);
48
- * ```
49
- */
50
- export declare function isAutomaticDataCollectionEnabled(
51
- inAppMessaging: FirebaseInAppMessaging,
52
- ): boolean;
53
-
54
- /**
55
- * Enable or disable automatic data collection for Firebase In-App Messaging.
56
- *
57
- * When enabled, generates a registration token on app startup if there is no valid one and generates a new token
58
- * when it is deleted (which prevents `deleteInstanceId()` from stopping the periodic sending of data).
59
- *
60
- * This setting is persisted across app restarts and overrides the setting specified in your manifest/plist file.
61
- *
62
- * #### Example
63
- *
64
- * ```js
65
- * // Disable data collection
66
- * const inAppMessaging = getInAppMessaging();
67
- * setAutomaticDataCollectionEnabled(inAppMessaging, false);
68
- * ```
69
- */
70
- export declare function setAutomaticDataCollectionEnabled(
71
- inAppMessaging: FirebaseInAppMessaging,
72
- enabled: boolean,
73
- ): Promise<null>;
74
-
75
- /**
76
- * Trigger in-app messages programmatically
77
- *
78
- * #### Example
79
- *
80
- * ```js
81
- * // Suppress messages
82
- * const inAppMessaging = getInAppMessaging();
83
- * await triggerEvent(inAppMessaging, "exampleTrigger");
84
- * ```
85
- */
86
- export declare function triggerEvent(
87
- inAppMessaging: FirebaseInAppMessaging,
88
- eventId: string,
89
- ): Promise<null>;
@@ -1,57 +0,0 @@
1
- import { getApp } from '@react-native-firebase/app';
2
-
3
- /**
4
- * @typedef {import("..").FirebaseApp} FirebaseApp
5
- * @typedef {import("..").FirebaseInAppMessagingTypes.Module} FirebaseInAppMessaging
6
- */
7
-
8
- /**
9
- * @returns {FirebaseInAppMessaging}
10
- */
11
- export function getInAppMessaging() {
12
- return getApp().inAppMessaging();
13
- }
14
-
15
- /**
16
- * @param {FirebaseInAppMessaging} inAppMessaging
17
- * @returns {boolean}
18
- */
19
- export function isMessagesDisplaySuppressed(inAppMessaging) {
20
- return inAppMessaging.isMessagesDisplaySuppressed;
21
- }
22
-
23
- /**
24
- *
25
- * @param {FirebaseInAppMessaging} inAppMessaging
26
- * @param {boolean} enabled
27
- * @returns {Promise<null>}
28
- */
29
- export function setMessagesDisplaySuppressed(inAppMessaging, enabled) {
30
- return inAppMessaging.setMessagesDisplaySuppressed(enabled);
31
- }
32
-
33
- /**
34
- * @param {FirebaseInAppMessaging} inAppMessaging
35
- * @returns {boolean}
36
- */
37
- export function isAutomaticDataCollectionEnabled(inAppMessaging) {
38
- return inAppMessaging.isAutomaticDataCollectionEnabled;
39
- }
40
-
41
- /**
42
- * @param {FirebaseInAppMessaging} inAppMessaging
43
- * @param {boolean} enabled
44
- * @returns {Promise<null>}
45
- */
46
- export function setAutomaticDataCollectionEnabled(inAppMessaging, enabled) {
47
- return inAppMessaging.setAutomaticDataCollectionEnabled(enabled);
48
- }
49
-
50
- /**
51
- * @param {FirebaseInAppMessaging} inAppMessaging
52
- * @param {string} eventId
53
- * @returns {Promise<null>}
54
- */
55
- export function triggerEvent(inAppMessaging, eventId) {
56
- return inAppMessaging.triggerEvent(eventId);
57
- }
package/lib/version.js DELETED
@@ -1,2 +0,0 @@
1
- // Generated by genversion.
2
- module.exports = '24.1.0';