|
3 | 3 | */ |
4 | 4 |
|
5 | 5 | import { |
6 | | - NativeModules, |
7 | | - NativeEventEmitter, |
8 | 6 | Linking, |
| 7 | + NativeEventEmitter, |
| 8 | + NativeModules, |
9 | 9 | Platform, |
10 | 10 | } from 'react-native'; |
11 | 11 |
|
| 12 | +import { IterableAction, IterableActionContext } from './IterableAction'; |
| 13 | +import { IterableConfig, AuthResponse } from './IterableConfig'; |
12 | 14 | import { |
13 | | - IterableInAppLocation, |
14 | 15 | IterableInAppCloseSource, |
15 | 16 | IterableInAppDeleteSource, |
| 17 | + IterableInAppLocation, |
16 | 18 | } from './IterableInAppClasses'; |
17 | 19 |
|
18 | 20 | import { IterableInAppManager } from './IterableInAppManager'; |
19 | 21 | import { IterableInAppMessage } from './IterableInAppMessage'; |
20 | | -import { AuthResponse, IterableConfig } from './IterableConfig'; |
21 | 22 | import { IterableLogger } from './IterableLogger'; |
22 | 23 |
|
23 | 24 | const RNIterableAPI = NativeModules.RNIterableAPI; |
24 | 25 | const RNEventEmitter = new NativeEventEmitter(RNIterableAPI); |
25 | 26 |
|
26 | | -/** |
27 | | - * Enum representing the source of IterableAction. |
28 | | - */ |
29 | | -export enum IterableActionSource { |
30 | | - push = 0, |
31 | | - appLink = 1, |
32 | | - inApp = 2, |
33 | | -} |
34 | | - |
35 | 27 | enum AuthResponseCallback { |
36 | 28 | SUCCESS, |
37 | 29 | FAILURE, |
38 | 30 | } |
39 | 31 |
|
40 | | -/** |
41 | | - * Enum representing what level of logs will Android and iOS project be printing on their consoles respectively. |
42 | | - */ |
43 | | -export enum IterableLogLevel { |
44 | | - debug = 1, |
45 | | - info = 2, |
46 | | - error = 3, |
47 | | -} |
48 | | - |
49 | | -/** |
50 | | - * IterableAction represents an action defined as a response to user events. |
51 | | - * It is currently used in push notification actions (open push & action buttons). |
52 | | - */ |
53 | | -export class IterableAction { |
54 | | - type: string; |
55 | | - data?: string; |
56 | | - userInput?: string; |
57 | | - |
58 | | - constructor(type: string, data?: string, userInput?: string) { |
59 | | - this.type = type; |
60 | | - this.data = data; |
61 | | - this.userInput = userInput; |
62 | | - } |
63 | | - |
64 | | - static fromDict(dict: any): IterableAction { |
65 | | - return new IterableAction(dict.type, dict.data, dict.userInput); |
66 | | - } |
67 | | -} |
68 | | - |
69 | | -export class IterableActionContext { |
70 | | - action: IterableAction; |
71 | | - source: IterableActionSource; |
72 | | - |
73 | | - constructor(action: IterableAction, source: IterableActionSource) { |
74 | | - this.action = action; |
75 | | - this.source = source; |
76 | | - } |
77 | | - |
78 | | - static fromDict(dict: any): IterableActionContext { |
79 | | - const action = IterableAction.fromDict(dict.action); |
80 | | - const source = dict.source as IterableActionSource; |
81 | | - return new IterableActionContext(action, source); |
82 | | - } |
83 | | -} |
84 | | - |
85 | 32 | export class IterableAttributionInfo { |
86 | 33 | campaignId: number; |
87 | 34 | templateId: number; |
|
0 commit comments