@inngageregistry/inngage-react 3.3.0-alpha.9 → 3.3.1-alpha.1
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inngageregistry/inngage-react",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.1-alpha.1",
|
|
4
4
|
"description": "Inngage Plugin for React Native applications for marketing campaign optimization using Push Notification.",
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"types": "src/index.d.ts",
|
package/src/Inngage.ts
CHANGED
|
@@ -103,6 +103,9 @@ const Inngage = {
|
|
|
103
103
|
phoneNumber,
|
|
104
104
|
email,
|
|
105
105
|
}: SubscriptionProps) => {
|
|
106
|
+
InngageProperties.appToken = appToken;
|
|
107
|
+
InngageProperties.identifier = friendlyIdentifier!;
|
|
108
|
+
|
|
106
109
|
try {
|
|
107
110
|
const respToken = await getFirebaseAccess()
|
|
108
111
|
|
|
@@ -196,6 +199,10 @@ const Inngage = {
|
|
|
196
199
|
} catch (e) {
|
|
197
200
|
console.error(e);
|
|
198
201
|
}
|
|
202
|
+
},
|
|
203
|
+
|
|
204
|
+
setDebugMode(value: boolean) {
|
|
205
|
+
InngageProperties.debugMode = value
|
|
199
206
|
}
|
|
200
207
|
}
|
|
201
208
|
|
|
@@ -5,4 +5,9 @@ export class InngageProperties {
|
|
|
5
5
|
static email: string = '';
|
|
6
6
|
static customFields: any = {};
|
|
7
7
|
static blockDeepLink: boolean = false;
|
|
8
|
+
static debugMode: boolean = false;
|
|
9
|
+
static firebaseToken: string = '';
|
|
10
|
+
static getDebugMode(): boolean {
|
|
11
|
+
return InngageProperties.debugMode;
|
|
12
|
+
}
|
|
8
13
|
}
|
package/src/services/inngage.ts
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
|
+
import { InngageProperties } from '../models/inngage_properties'
|
|
1
2
|
import { fetchClient } from './handler'
|
|
2
3
|
|
|
3
4
|
export const subscriptionApi = (request, dev = false) => {
|
|
4
|
-
if (
|
|
5
|
+
if (InngageProperties.getDebugMode())
|
|
5
6
|
console.log('subscriptionApi', request)
|
|
6
7
|
return fetchClient('POST', request, '/subscription/', !!dev)
|
|
7
8
|
}
|
|
8
9
|
export const notificationApi = (request, dev = false) => {
|
|
9
|
-
if (
|
|
10
|
+
if (InngageProperties.getDebugMode())
|
|
10
11
|
console.log('notificationApi', request)
|
|
11
12
|
return fetchClient('POST', request, '/notification/', !!dev)
|
|
12
13
|
}
|
|
13
14
|
export const eventsApi = (request, dev = false) => {
|
|
14
|
-
if (
|
|
15
|
+
if (InngageProperties.getDebugMode())
|
|
15
16
|
console.log('eventsApi', request)
|
|
16
17
|
return fetchClient('POST', request, '/events/newEvent/', !!dev)
|
|
17
18
|
}
|
|
18
19
|
export const addUserDataApi = (request, dev = false) => {
|
|
19
|
-
if (
|
|
20
|
+
if (InngageProperties.getDebugMode())
|
|
20
21
|
console.log('addUserData', request)
|
|
21
22
|
return fetchClient('POST', request, '/subscription/addCustomField', !!dev)
|
|
22
23
|
}
|