@inngageregistry/inngage-react 4.0.0-beta.2 → 4.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 (42) hide show
  1. package/README.md +60 -60
  2. package/dist/Inngage.d.ts +28 -0
  3. package/dist/Inngage.js +149 -0
  4. package/dist/api/api.d.ts +4 -0
  5. package/{src/api/api.ts → dist/api/api.js} +22 -28
  6. package/dist/api/handler.d.ts +1 -0
  7. package/dist/api/handler.js +44 -0
  8. package/dist/components/in_app.d.ts +6 -0
  9. package/dist/components/in_app.js +92 -0
  10. package/dist/components/modal.d.ts +26 -0
  11. package/dist/components/modal.js +158 -0
  12. package/dist/components/styles.d.ts +88 -0
  13. package/dist/components/styles.js +86 -0
  14. package/dist/firebase/notifications_listener.d.ts +6 -0
  15. package/dist/firebase/notifications_listener.js +170 -0
  16. package/{src/index.ts → dist/index.d.ts} +6 -11
  17. package/dist/index.js +6 -0
  18. package/dist/models/inngage_properties.d.ts +11 -0
  19. package/dist/models/inngage_properties.js +13 -0
  20. package/dist/models/requests.d.ts +40 -0
  21. package/{src/models/requests.ts → dist/models/requests.js} +40 -42
  22. package/dist/services/api_services.d.ts +7 -0
  23. package/{src/services/api_services.ts → dist/services/api_services.js} +25 -30
  24. package/dist/services/handler.d.ts +1 -0
  25. package/dist/services/handler.js +38 -0
  26. package/dist/services/inngage.d.ts +4 -0
  27. package/dist/services/inngage.js +22 -0
  28. package/dist/utils.d.ts +4 -0
  29. package/dist/utils.js +25 -0
  30. package/package.json +79 -40
  31. package/.editorconfig +0 -6
  32. package/src/Inngage.ts +0 -193
  33. package/src/api/handler.ts +0 -53
  34. package/src/components/in_app.tsx +0 -192
  35. package/src/components/modal.tsx +0 -221
  36. package/src/components/styles.ts +0 -88
  37. package/src/firebase/notifications_listener.ts +0 -182
  38. package/src/models/inngage_properties.ts +0 -13
  39. package/src/services/handler.ts +0 -41
  40. package/src/services/inngage.ts +0 -23
  41. package/src/utils.ts +0 -35
  42. package/tsconfig.json +0 -27
package/README.md CHANGED
@@ -1,61 +1,61 @@
1
- <h1 align="center">
2
- <b>
3
- <a href="https://inngage.com.br/"><img src="https://inngage.com.br/wp-content/uploads/2022/03/inngage-small.png" /></a><br>
4
- </b>
5
- </h1>
6
-
7
- <p align="center">Pacote Inngage para aplicativos React Native para otimização de campanhas de marketing usando notificações push.</p>
8
-
9
- <p align="center">
10
- <a href="https://inngage.com.br/"><b>Website</b></a> •
11
- <a href="https://inngage.readme.io/docs/react-native-sdk-20"><b>Documentation</b></a>
12
- </p>
13
-
14
- <div align="center">
15
-
16
- [![npm version](https://img.shields.io/npm/v/@inngageregistry/inngage-react.svg?style=flat-square)](https://www.npmjs.org/package/@inngageregistry/inngage-react)
17
-
18
- </div>
19
-
20
- ## Instalação
21
- ### Ambiente de desenvolvimento
22
- Antes de começar a utilizar nossa SDK, instale as dependências externas utilizadas:
23
- ```bash
24
- "dependencies": {
25
- "@react-native-async-storage/async-storage": "^1.18.1",
26
- "@react-native-community/push-notification-ios": "^1.11.0",
27
- "@react-native-firebase/app": "^17.4.2",
28
- "@react-native-firebase/messaging": "^17.4.2",
29
- "react-native-device-info": "^10.6.0",
30
- "react-native-localize": "^2.2.6",
31
- "react-native-permissions": "^3.8.0",
32
- "react-native-push-notification": "^8.1.1",
33
- "react-native-inappbrowser-reborn": "^3.7.0",
34
- }
35
- ```
36
- > 📘 *Recomendação*: Certifique-se de instalar as versões conforme especificado nesta documentação. Para a dependência react-native-inappbrowser-reborn, siga as instruções da seção "Getting Started" na documentação oficial para garantir o funcionamento adequado na abertura de URLs do tipo Weblink. Consulte o link a seguir para mais detalhes:
37
- >
38
- > <https://www.npmjs.com/package/react-native-inappbrowser-reborn>
39
-
40
- ### Importando o FCM Token (API Key)
41
- Para aproveitar nossa SDK, será necessário importar o FCM Token (API Key) do seu projeto Firebase em nossa plataforma. Siga o passo a passo neste [link]("https://inngage.readme.io/docs/firebase-console#configura%C3%A7%C3%B5es-do-projeto-firebase") para executar essa ação.
42
-
43
- ### Instalando o package utilizando o NPM ou YARN
44
-
45
- Para adicionar a SDK da Inngage ao seu projeto, execute o seguinte comando utilizando o NPM:
46
- ```
47
- npm i @inngageregistry/inngage-react
48
- ```
49
- Este comando adiciona a seguinte linha no arquivo _package.json_ de seu pacote:
50
- ```
51
- "dependencies": {
52
- "@inngageregistry/inngage-react": "^4.0.0-beta.2",
53
- }
54
- ```
55
- > 📘 Se a instalação via `npm` não funcionar corretamente, você pode instalar a dependência utilizando o `yarn`.
56
- > 📘
57
-
58
- Para instalar a SDK com o yarn, siga os passos abaixo:
59
-
60
- 1. No arquivo `package.json`, adicione a seguinte dependência em `dependencies`: **"@inngageregistry/inngage-react": "^4.0.0-beta.2"**.
1
+ <h1 align="center">
2
+ <b>
3
+ <a href="https://inngage.com.br/"><img src="https://inngage.com.br/wp-content/uploads/2022/03/inngage-small.png" /></a><br>
4
+ </b>
5
+ </h1>
6
+
7
+ <p align="center">Pacote Inngage para aplicativos React Native para otimização de campanhas de marketing usando notificações push.</p>
8
+
9
+ <p align="center">
10
+ <a href="https://inngage.com.br/"><b>Website</b></a> •
11
+ <a href="https://inngage.readme.io/docs/react-native-sdk-20"><b>Documentation</b></a>
12
+ </p>
13
+
14
+ <div align="center">
15
+
16
+ [![npm version](https://img.shields.io/npm/v/@inngageregistry/inngage-react.svg?style=flat-square)](https://www.npmjs.org/package/@inngageregistry/inngage-react)
17
+
18
+ </div>
19
+
20
+ ## Instalação
21
+ ### Ambiente de desenvolvimento
22
+ Antes de começar a utilizar nossa SDK, instale as dependências externas utilizadas:
23
+ ```bash
24
+ "dependencies": {
25
+ "@react-native-async-storage/async-storage": "^1.18.1",
26
+ "@react-native-community/push-notification-ios": "^1.11.0",
27
+ "@react-native-firebase/app": "^17.4.2",
28
+ "@react-native-firebase/messaging": "^17.4.2",
29
+ "react-native-device-info": "^10.6.0",
30
+ "react-native-localize": "^2.2.6",
31
+ "react-native-permissions": "^3.8.0",
32
+ "react-native-push-notification": "^8.1.1",
33
+ "react-native-inappbrowser-reborn": "^3.7.0",
34
+ }
35
+ ```
36
+ > 📘 *Recomendação*: Certifique-se de instalar as versões conforme especificado nesta documentação. Para a dependência react-native-inappbrowser-reborn, siga as instruções da seção "Getting Started" na documentação oficial para garantir o funcionamento adequado na abertura de URLs do tipo Weblink. Consulte o link a seguir para mais detalhes:
37
+ >
38
+ > <https://www.npmjs.com/package/react-native-inappbrowser-reborn>
39
+
40
+ ### Importando o FCM Token (API Key)
41
+ Para aproveitar nossa SDK, será necessário importar o FCM Token (API Key) do seu projeto Firebase em nossa plataforma. Siga o passo a passo neste [link]("https://inngage.readme.io/docs/firebase-console#configura%C3%A7%C3%B5es-do-projeto-firebase") para executar essa ação.
42
+
43
+ ### Instalando o package utilizando o NPM ou YARN
44
+
45
+ Para adicionar a SDK da Inngage ao seu projeto, execute o seguinte comando utilizando o NPM:
46
+ ```
47
+ npm i @inngageregistry/inngage-react
48
+ ```
49
+ Este comando adiciona a seguinte linha no arquivo _package.json_ de seu pacote:
50
+ ```
51
+ "dependencies": {
52
+ "@inngageregistry/inngage-react": "^4.0.0-beta.2",
53
+ }
54
+ ```
55
+ > 📘 Se a instalação via `npm` não funcionar corretamente, você pode instalar a dependência utilizando o `yarn`.
56
+ > 📘
57
+
58
+ Para instalar a SDK com o yarn, siga os passos abaixo:
59
+
60
+ 1. No arquivo `package.json`, adicione a seguinte dependência em `dependencies`: **"@inngageregistry/inngage-react": "^4.0.0-beta.2"**.
61
61
  2. No terminal, dentro da pasta do seu projeto, execute o comando: **yarn install**. Isso irá instalar a SDK corretamente.
@@ -0,0 +1,28 @@
1
+ interface SubscriptionProps {
2
+ appToken: string;
3
+ dev?: boolean;
4
+ friendlyIdentifier?: string;
5
+ customFields?: any;
6
+ customData?: any;
7
+ phoneNumber?: string;
8
+ email?: string;
9
+ }
10
+ interface SendEventProps {
11
+ eventName: string;
12
+ conversionEvent?: boolean;
13
+ conversionValue?: number;
14
+ conversionNotId?: string;
15
+ eventValues?: any;
16
+ }
17
+ declare class Inngage {
18
+ private static instance;
19
+ private apiService;
20
+ constructor();
21
+ static getInstance(): Inngage;
22
+ static notificationListener(firebaseListenCallback?: any): void;
23
+ static subscribe({ appToken, friendlyIdentifier, customFields, phoneNumber, email, }: SubscriptionProps): Promise<Response>;
24
+ static sendEvent({ eventName, conversionEvent, conversionValue, conversionNotId, eventValues, }: SendEventProps): Promise<Response>;
25
+ static addUserData(customFields: any): Promise<any>;
26
+ static setDebugMode(value: boolean): void;
27
+ }
28
+ export default Inngage;
@@ -0,0 +1,149 @@
1
+ import { Platform } from 'react-native';
2
+ import { getApp } from '@react-native-firebase/app';
3
+ import { AuthorizationStatus, getMessaging, getToken as getFcmTokenFromMessaging, isDeviceRegisteredForRemoteMessages, registerDeviceForRemoteMessages, requestPermission, } from '@react-native-firebase/messaging';
4
+ import DeviceInfo from 'react-native-device-info';
5
+ import * as RNLocalize from 'react-native-localize';
6
+ import AsyncStorage from '@react-native-async-storage/async-storage';
7
+ import { formatDate } from './utils';
8
+ import { InngageNotificationMessage } from './firebase/notifications_listener';
9
+ import { InngageProperties } from './models/inngage_properties';
10
+ import RNPermissions, { RESULTS } from 'react-native-permissions';
11
+ import ApiService from './services/api_services';
12
+ import notifee from '@notifee/react-native';
13
+ const API_LEVEL_33 = 33;
14
+ const app = getApp();
15
+ const messagingInstance = getMessaging(app);
16
+ const getFirebaseAccess = async () => {
17
+ return handleNotificationsPermission();
18
+ };
19
+ const handleNotificationsPermission = async () => {
20
+ const options = ['alert', 'badge', 'sound'];
21
+ const apiLevel = Platform.OS === 'android' ? await DeviceInfo.getApiLevel() : 0;
22
+ let permissionGranted = false;
23
+ if (Platform.OS === 'android') {
24
+ if (apiLevel >= API_LEVEL_33) {
25
+ const result = await RNPermissions.requestNotifications(options);
26
+ permissionGranted = result.status === RESULTS.GRANTED;
27
+ }
28
+ else {
29
+ permissionGranted = true;
30
+ }
31
+ }
32
+ else {
33
+ const status = await requestPermission(messagingInstance);
34
+ permissionGranted =
35
+ status === AuthorizationStatus.AUTHORIZED ||
36
+ status === AuthorizationStatus.PROVISIONAL;
37
+ if (notifee) {
38
+ try {
39
+ await notifee.requestPermission();
40
+ }
41
+ catch { }
42
+ }
43
+ }
44
+ if (permissionGranted) {
45
+ return getFirebaseToken();
46
+ }
47
+ throw new Error('Notification permission not granted');
48
+ };
49
+ const getFirebaseToken = async () => {
50
+ let fcmToken = await AsyncStorage.getItem('fcmToken');
51
+ if (!fcmToken) {
52
+ const isRegistered = (isDeviceRegisteredForRemoteMessages(messagingInstance) ?? false);
53
+ if (!isRegistered && typeof registerDeviceForRemoteMessages === 'function') {
54
+ await registerDeviceForRemoteMessages(messagingInstance);
55
+ }
56
+ const newFcmToken = typeof getFcmTokenFromMessaging(messagingInstance) === 'function' ? await getFcmTokenFromMessaging(messagingInstance) : null;
57
+ if (newFcmToken) {
58
+ await AsyncStorage.setItem('fcmToken', newFcmToken);
59
+ return newFcmToken;
60
+ }
61
+ }
62
+ return fcmToken || null;
63
+ };
64
+ class Inngage {
65
+ constructor() {
66
+ this.apiService = new ApiService();
67
+ }
68
+ static getInstance() {
69
+ if (!Inngage.instance) {
70
+ Inngage.instance = new Inngage();
71
+ }
72
+ return Inngage.instance;
73
+ }
74
+ static notificationListener(firebaseListenCallback) {
75
+ try {
76
+ InngageNotificationMessage(firebaseListenCallback);
77
+ }
78
+ catch (e) {
79
+ console.log(e);
80
+ }
81
+ }
82
+ static async subscribe({ appToken, friendlyIdentifier, customFields, phoneNumber, email, }) {
83
+ const inngage = Inngage.getInstance();
84
+ InngageProperties.appToken = appToken;
85
+ InngageProperties.identifier = friendlyIdentifier;
86
+ const respToken = await getFirebaseAccess();
87
+ const { countryCode: osLocale, languageCode: osLanguage } = RNLocalize.getLocales()[0] || {};
88
+ const deviceManufacturer = await DeviceInfo.getManufacturer();
89
+ const installTime = await DeviceInfo.getFirstInstallTime();
90
+ const lastUpdateTime = await DeviceInfo.getLastUpdateTime();
91
+ const uuid = await DeviceInfo.getUniqueId();
92
+ const appInstalledIn = formatDate(installTime);
93
+ const appUpdatedIn = formatDate(lastUpdateTime);
94
+ const subscription = {
95
+ registerSubscriberRequest: {
96
+ app_token: appToken,
97
+ identifier: friendlyIdentifier,
98
+ registration: respToken,
99
+ platform: DeviceInfo.getSystemName(),
100
+ sdk: DeviceInfo.getBuildNumber(),
101
+ deviceModel: DeviceInfo.getModel(),
102
+ deviceManufacturer,
103
+ osLocale,
104
+ osLanguage,
105
+ os_version: DeviceInfo.getReadableVersion(),
106
+ app_version: DeviceInfo.getBuildNumber(),
107
+ appInstalledIn,
108
+ appUpdatedIn,
109
+ uuid,
110
+ phone_Number: phoneNumber,
111
+ email: email,
112
+ customFields: customFields,
113
+ },
114
+ };
115
+ return inngage.apiService.subscribe(subscription);
116
+ }
117
+ static async sendEvent({ eventName, conversionEvent = false, conversionValue = 0, conversionNotId = '', eventValues, }) {
118
+ const inngage = Inngage.getInstance();
119
+ const registration = await getFirebaseAccess();
120
+ const request = {
121
+ newEventRequest: {
122
+ app_token: InngageProperties.appToken,
123
+ identifier: InngageProperties.identifier,
124
+ registration,
125
+ event_name: eventName,
126
+ conversion_event: conversionEvent,
127
+ conversion_value: conversionValue,
128
+ conversion_notid: conversionNotId,
129
+ event_values: eventValues,
130
+ },
131
+ };
132
+ return inngage.apiService.sendEvent(request);
133
+ }
134
+ static async addUserData(customFields) {
135
+ const inngage = Inngage.getInstance();
136
+ const request = {
137
+ fieldsRequest: {
138
+ appToken: InngageProperties.appToken,
139
+ identifier: InngageProperties.identifier,
140
+ customField: customFields,
141
+ },
142
+ };
143
+ return inngage.apiService.addUserData(request);
144
+ }
145
+ static setDebugMode(value) {
146
+ InngageProperties.debugMode = value;
147
+ }
148
+ }
149
+ export default Inngage;
@@ -0,0 +1,4 @@
1
+ export declare const subscriptionApi: (request: any) => Promise<Response>;
2
+ export declare const notificationApi: (request: any) => Promise<Response>;
3
+ export declare const eventsApi: (request: any) => Promise<Response>;
4
+ export declare const addUserDataApi: (request: any) => Promise<Response>;
@@ -1,28 +1,22 @@
1
- import { fetchClient } from './handler'
2
-
3
- const apiEndpoints = {
4
- subscription: '/subscription/',
5
- notification: '/notification/',
6
- events: '/events/newEvent/',
7
- addUserData: '/subscription/addCustomField',
8
- };
9
-
10
- const makeApiCall = (method: string, request: any, endpoint: string) => {
11
- return fetchClient(method, request, endpoint);
12
- };
13
-
14
- export const subscriptionApi = (request: any) => {
15
- return makeApiCall('POST', request, apiEndpoints.subscription);
16
- };
17
-
18
- export const notificationApi = (request: any) => {
19
- return makeApiCall('POST', request, apiEndpoints.notification);
20
- };
21
-
22
- export const eventsApi = (request: any) => {
23
- return makeApiCall('POST', request, apiEndpoints.events);
24
- };
25
-
26
- export const addUserDataApi = (request: any) => {
27
- return makeApiCall('POST', request, apiEndpoints.addUserData);
28
- };
1
+ import { fetchClient } from './handler';
2
+ const apiEndpoints = {
3
+ subscription: '/subscription/',
4
+ notification: '/notification/',
5
+ events: '/events/newEvent/',
6
+ addUserData: '/subscription/addCustomField',
7
+ };
8
+ const makeApiCall = (method, request, endpoint) => {
9
+ return fetchClient(method, request, endpoint);
10
+ };
11
+ export const subscriptionApi = (request) => {
12
+ return makeApiCall('POST', request, apiEndpoints.subscription);
13
+ };
14
+ export const notificationApi = (request) => {
15
+ return makeApiCall('POST', request, apiEndpoints.notification);
16
+ };
17
+ export const eventsApi = (request) => {
18
+ return makeApiCall('POST', request, apiEndpoints.events);
19
+ };
20
+ export const addUserDataApi = (request) => {
21
+ return makeApiCall('POST', request, apiEndpoints.addUserData);
22
+ };
@@ -0,0 +1 @@
1
+ export declare const fetchClient: (method: string, requestBody: any, path: string, isDev?: boolean) => Promise<Response>;
@@ -0,0 +1,44 @@
1
+ const baseUrlHook = {
2
+ [false]: 'https://api.inngage.com.br/v1',
3
+ [undefined]: 'https://api.inngage.com.br/v1',
4
+ [null]: 'https://api.inngage.com.br/v1',
5
+ [true]: 'https://apid.inngage.com.br/v1',
6
+ };
7
+ const requestConfigFactory = (method, request) => {
8
+ let header = {
9
+ Accept: 'application/json',
10
+ 'Content-Type': 'application/json',
11
+ };
12
+ try {
13
+ if (request?.registerSubscriberRequest?.authKey) {
14
+ header = {
15
+ ...header,
16
+ Authorization: request.registerSubscriberRequest.authKey
17
+ };
18
+ }
19
+ }
20
+ catch (e) {
21
+ console.error(e);
22
+ }
23
+ let objToSend = {
24
+ method,
25
+ body: JSON.stringify(request),
26
+ headers: header
27
+ };
28
+ return objToSend;
29
+ };
30
+ export const fetchClient = async (method, requestBody, path, isDev = false) => {
31
+ try {
32
+ const url = `${baseUrlHook[isDev]}${path}`;
33
+ const request = requestConfigFactory(method, requestBody);
34
+ const response = await fetch(url, request);
35
+ if (!response.ok) {
36
+ throw new Error(`Network response was not ok (${response.status})`);
37
+ }
38
+ return response;
39
+ }
40
+ catch (error) {
41
+ console.error('Fetch Error:', error.message);
42
+ throw error;
43
+ }
44
+ };
@@ -0,0 +1,6 @@
1
+ import * as React from "react";
2
+ interface InAppProps {
3
+ onDismiss: () => void;
4
+ }
5
+ export declare function InApp({ onDismiss }: InAppProps): React.JSX.Element;
6
+ export {};
@@ -0,0 +1,92 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import { StyleSheet, Image, View, Text, TouchableOpacity, ImageBackground, Dimensions, Linking, } from "react-native";
4
+ import AsyncStorage from "@react-native-async-storage/async-storage";
5
+ import { buildStyles } from "./styles";
6
+ import { Modal } from "./modal";
7
+ import { InngageProperties } from "../models/inngage_properties";
8
+ import InAppBrowser from 'react-native-inappbrowser-reborn';
9
+ export function InApp({ onDismiss }) {
10
+ const { width: screenWidth } = Dimensions.get('window');
11
+ const sliderWidth = screenWidth;
12
+ const itemWidth = screenWidth * 0.9;
13
+ const [data, setData] = React.useState();
14
+ const [richContent, setRichContent] = React.useState();
15
+ const [visible, setVisible] = React.useState(false);
16
+ React.useEffect(() => {
17
+ const fetchAdditionalData = async () => {
18
+ try {
19
+ console.log('in app message');
20
+ const data = await AsyncStorage.getItem('inapp');
21
+ console.log(data);
22
+ if (data) {
23
+ const parsedData = JSON.parse(data);
24
+ const richContentData = parsedData.rich_content;
25
+ setVisible(true);
26
+ setData(parsedData);
27
+ setRichContent(richContentData);
28
+ }
29
+ }
30
+ catch (error) {
31
+ console.error('Error retrieving additionalData from AsyncStorage:', error);
32
+ }
33
+ };
34
+ fetchAdditionalData();
35
+ }, []);
36
+ const styles = buildStyles(data, screenWidth * 0.9);
37
+ const handleDismissInApp = async () => {
38
+ await AsyncStorage.removeItem('inapp');
39
+ setVisible(false);
40
+ onDismiss();
41
+ };
42
+ const handleClick = async (link, type) => {
43
+ if (type === 'inapp') {
44
+ try {
45
+ if (await InAppBrowser.isAvailable()) {
46
+ await InAppBrowser.open(link, {
47
+ dismissButtonStyle: 'close',
48
+ preferredBarTintColor: '#453AA4',
49
+ preferredControlTintColor: 'white',
50
+ enableDefaultShare: true,
51
+ enableBarCollapsing: true,
52
+ });
53
+ }
54
+ else {
55
+ Linking.openURL(link);
56
+ }
57
+ }
58
+ catch (error) {
59
+ console.error(error);
60
+ }
61
+ }
62
+ else if (type === 'deep') {
63
+ Linking.openURL(link).catch((err) => console.error('Erro ao abrir o link:', err));
64
+ }
65
+ };
66
+ const imageUrls = [
67
+ richContent?.img1 ?? '',
68
+ richContent?.img2 ?? '',
69
+ richContent?.img3 ?? '',
70
+ richContent?.img4 ?? '',
71
+ richContent?.img5 ?? ''
72
+ ];
73
+ const stylesCarousel = StyleSheet.create({
74
+ itemContainer: {
75
+ justifyContent: 'center',
76
+ height: 250
77
+ },
78
+ itemImg: {
79
+ height: 250,
80
+ },
81
+ });
82
+ const _renderItem = ({ item, index }) => {
83
+ return (_jsx(View, { style: stylesCarousel.itemContainer, children: _jsx(Image, { style: [stylesCarousel.itemImg], source: { uri: item } }) }));
84
+ };
85
+ if (InngageProperties.getDebugMode() && data != null) {
86
+ console.log('INNGAGE - Data In App:', data);
87
+ console.log('INNGAGE - Data Rich Content:', richContent);
88
+ }
89
+ return (_jsx(Modal, { onBackdropPress: handleDismissInApp, renderToHardwareTextureAndroid: true, transparent: true, visible: visible, children: _jsxs(ImageBackground, { style: styles.content, source: { uri: data?.background_image }, children: [_jsx(TouchableOpacity, { style: styles.closeButton, onPress: handleDismissInApp, children: _jsx(Text, { style: styles.textButton, children: "X" }) }), _jsxs(View, { style: styles.messageData, children: [_jsx(Text, { style: styles.title, children: data?.title }), _jsx(Text, { style: styles.body, children: data?.body })] }), _jsxs(View, { style: styles.footer, children: [data?.btn_left_txt != null ?
90
+ _jsx(TouchableOpacity, { style: styles.buttonLeft, onPress: () => handleClick(data?.btn_left_action_link, data?.btn_left_action_type), children: _jsx(Text, { style: styles.textButtonLeft, children: data?.btn_left_txt }) }) : null, data?.btn_right_txt != null ?
91
+ _jsx(TouchableOpacity, { style: styles.buttonRight, onPress: () => handleClick(data?.btn_right_action_link, data?.btn_right_action_type), children: _jsx(Text, { style: styles.textButtonRight, children: data?.btn_right_txt }) }) : null] })] }) }));
92
+ }
@@ -0,0 +1,26 @@
1
+ import { Animated, ModalProps as ReactNativeModalProps, StyleProp, ViewStyle } from "react-native";
2
+ import { Component } from "react";
3
+ export interface ModalProps extends ReactNativeModalProps {
4
+ onBackdropPress?: () => void;
5
+ onHide?: () => void;
6
+ visible?: boolean;
7
+ contentStyle?: StyleProp<ViewStyle>;
8
+ useNativeDriver?: boolean;
9
+ }
10
+ interface ModalState {
11
+ visible: boolean;
12
+ currentAnimation: "none" | "in" | "out";
13
+ }
14
+ export declare class Modal extends Component<ModalProps, ModalState> {
15
+ static defaultProps: Partial<ModalProps>;
16
+ state: ModalState;
17
+ animVal: Animated.Value;
18
+ _isMounted: boolean;
19
+ componentDidMount(): void;
20
+ componentWillUnmount(): void;
21
+ componentDidUpdate(prevProps: ModalProps): void;
22
+ show: () => void;
23
+ hide: () => void;
24
+ render(): import("react/jsx-runtime").JSX.Element;
25
+ }
26
+ export default Modal;