cordova-plugin-appice 2.0.10 → 2.1.2
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/example/www/js/index.js +90 -81
- package/package.json +1 -1
- package/plugin.xml +7 -4
- package/scripts/BeforeAndroidBuilt.js +63 -34
- package/src/android/AppICEFCMPush.java +26 -0
- package/src/android/AppICEMFPPush.java +24 -134
- package/src/android/AppICEPlugin.java +118 -11
- package/src/android/AppICEPushHandler.java +163 -0
- package/src/ios/AppDelegate+AppICEPlugin.m +177 -87
- package/src/ios/AppICEPlugin.h +3 -0
- package/src/ios/AppICEPlugin.m +21 -86
- package/www/AppICE.js +310 -263
package/www/AppICE.js
CHANGED
|
@@ -1,289 +1,336 @@
|
|
|
1
|
+
cordova.define("cordova-plugin-appice.AppICE", function (require, exports, module) {
|
|
2
|
+
|
|
3
|
+
var AppICE = function () { }
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
//===================================
|
|
7
|
+
// SDK CONFIG APIS
|
|
8
|
+
//===================================
|
|
9
|
+
|
|
10
|
+
AppICE.prototype.validateIntegration = function (success, error) {
|
|
11
|
+
cordova.exec(success, error, "AppICEPlugin", "validateIntegration", []);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
AppICE.prototype.startContext = function (gcmID, success, error) {
|
|
15
|
+
cordova.exec(success, error, "AppICEPlugin", "startContext", [{ "gcmID": gcmID }]);
|
|
16
|
+
|
|
17
|
+
var inputArr = [];
|
|
18
|
+
var inputs = document.getElementsByTagName('input');
|
|
19
|
+
for (var index = 0; index < inputs.length; ++index) {
|
|
20
|
+
var element = inputs[index];
|
|
21
|
+
var data = {
|
|
22
|
+
"t": element.tagName,
|
|
23
|
+
"i": element.id,
|
|
24
|
+
"n": element.name,
|
|
25
|
+
"y": element.getBoundingClientRect().top + window.scrollY,
|
|
26
|
+
"x": element.getBoundingClientRect().left + window.scrollX,
|
|
27
|
+
"w": element.getBoundingClientRect().width,
|
|
28
|
+
"h": element.getBoundingClientRect().height
|
|
29
|
+
};
|
|
30
|
+
inputArr.push(data);
|
|
31
|
+
}
|
|
1
32
|
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"n": element.name,
|
|
24
|
-
"y": element.getBoundingClientRect().top + window.scrollY,
|
|
25
|
-
"x": element.getBoundingClientRect().left + window.scrollX,
|
|
26
|
-
"w": element.getBoundingClientRect().width,
|
|
27
|
-
"h": element.getBoundingClientRect().height
|
|
28
|
-
};
|
|
29
|
-
inputArr.push(data);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
cordova.exec(success, error, "AppICEPlugin", "trackScreens",
|
|
33
|
-
[{ "old": "", "new": "", "loc": location.hash, "h": document.documentElement.clientHeight, "w": document.documentElement.clientWidth, "arr": inputArr }]);
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
AppICE.prototype.initSdk = function (appID, appKey, apiKey, gcmID, region, baseUrl, certs, success, error) {
|
|
37
|
-
cordova.exec(success, error, "AppICEPlugin", "initSdk", [{ "appID": appID, "appKey": appKey, "apiKey": apiKey, "gcmID": gcmID, "region": region, "baseUrl": baseUrl, "certs": certs }]);
|
|
38
|
-
var inputArr = [];
|
|
39
|
-
var inputs = document.getElementsByTagName('input');
|
|
40
|
-
for (var index = 0; index < inputs.length; ++index) {
|
|
41
|
-
var element = inputs[index];
|
|
42
|
-
var data = {
|
|
43
|
-
"t": element.tagName,
|
|
44
|
-
"i": element.id,
|
|
45
|
-
"n": element.name,
|
|
46
|
-
"y": element.getBoundingClientRect().top + window.scrollY,
|
|
47
|
-
"x": element.getBoundingClientRect().left + window.scrollX,
|
|
48
|
-
"w": element.getBoundingClientRect().width,
|
|
49
|
-
"h": element.getBoundingClientRect().height
|
|
50
|
-
};
|
|
51
|
-
inputArr.push(data);
|
|
52
|
-
}
|
|
33
|
+
cordova.exec(success, error, "AppICEPlugin", "trackScreens",
|
|
34
|
+
[{ "old": "", "new": "", "loc": location.hash, "h": document.documentElement.clientHeight, "w": document.documentElement.clientWidth, "arr": inputArr }]);
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
AppICE.prototype.initSdk = function (appID, appKey, apiKey, gcmID, region, baseUrl, certs, success, error) {
|
|
38
|
+
cordova.exec(success, error, "AppICEPlugin", "initSdk", [{ "appID": appID, "appKey": appKey, "apiKey": apiKey, "gcmID": gcmID, "region": region, "baseUrl": baseUrl, "certs": certs }]);
|
|
39
|
+
var inputArr = [];
|
|
40
|
+
var inputs = document.getElementsByTagName('input');
|
|
41
|
+
for (var index = 0; index < inputs.length; ++index) {
|
|
42
|
+
var element = inputs[index];
|
|
43
|
+
var data = {
|
|
44
|
+
"t": element.tagName,
|
|
45
|
+
"i": element.id,
|
|
46
|
+
"n": element.name,
|
|
47
|
+
"y": element.getBoundingClientRect().top + window.scrollY,
|
|
48
|
+
"x": element.getBoundingClientRect().left + window.scrollX,
|
|
49
|
+
"w": element.getBoundingClientRect().width,
|
|
50
|
+
"h": element.getBoundingClientRect().height
|
|
51
|
+
};
|
|
52
|
+
inputArr.push(data);
|
|
53
|
+
}
|
|
53
54
|
|
|
54
|
-
|
|
55
|
-
};
|
|
55
|
+
cordova.exec(success, error, "AppICEPlugin", "trackScreens", [{ "old": "", "new": "", "loc": location.hash, "h": document.documentElement.clientHeight, "w": document.documentElement.clientWidth, "arr": inputArr }]);
|
|
56
|
+
};
|
|
56
57
|
|
|
57
|
-
AppICE.prototype.stopContext = function (success, error) {
|
|
58
|
-
|
|
59
|
-
};
|
|
58
|
+
AppICE.prototype.stopContext = function (success, error) {
|
|
59
|
+
cordova.exec(success, error, "AppICEPlugin", "stopContext", []);
|
|
60
|
+
};
|
|
60
61
|
|
|
61
|
-
AppICE.prototype.getCurrentContext = function (success, error) {
|
|
62
|
-
|
|
63
|
-
}
|
|
62
|
+
AppICE.prototype.getCurrentContext = function (success, error) {
|
|
63
|
+
cordova.exec(success, error, "AppICEPlugin", "getCurrentContext", []);
|
|
64
|
+
};
|
|
64
65
|
|
|
65
|
-
AppICE.prototype.registerLifeCycle = function (success, error) {
|
|
66
|
-
|
|
67
|
-
}
|
|
66
|
+
AppICE.prototype.registerLifeCycle = function (success, error) {
|
|
67
|
+
cordova.exec(success, error, "AppICEPlugin", "registerLifeCycle", []);
|
|
68
|
+
};
|
|
68
69
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
AppICE.prototype.isDeviceReady = function (success, error) {
|
|
71
|
+
cordova.exec(success, error, "AppICEPlugin", "isDeviceReady", []);
|
|
72
|
+
};
|
|
72
73
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
//==================================
|
|
75
|
+
// PLAY STORE SETTING APIS
|
|
76
|
+
//==================================
|
|
76
77
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
AppICE.prototype.openPlayServiceUpdate = function (success, error) {
|
|
79
|
+
cordova.exec(success, error, "AppICEPlugin", "openPlayServiceUpdate", []);
|
|
80
|
+
};
|
|
80
81
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
82
|
+
//===================================
|
|
83
|
+
// SDK METADATA APIS
|
|
84
|
+
//===================================
|
|
84
85
|
|
|
85
|
-
AppICE.prototype.
|
|
86
|
-
|
|
87
|
-
}
|
|
86
|
+
AppICE.prototype.getAppKey = function (success, error) {
|
|
87
|
+
cordova.exec(success, error, "AppICEPlugin", "getAppKey", []);
|
|
88
|
+
}
|
|
88
89
|
|
|
89
|
-
AppICE.prototype.
|
|
90
|
-
|
|
91
|
-
}
|
|
90
|
+
AppICE.prototype.getApiKey = function (success, error) {
|
|
91
|
+
cordova.exec(success, error, "AppICEPlugin", "getApiKey", []);
|
|
92
|
+
}
|
|
92
93
|
|
|
93
|
-
AppICE.prototype.
|
|
94
|
-
|
|
95
|
-
}
|
|
94
|
+
AppICE.prototype.getAppId = function (success, error) {
|
|
95
|
+
cordova.exec(success, error, "AppICEPlugin", "getAppId", []);
|
|
96
|
+
}
|
|
96
97
|
|
|
97
|
-
AppICE.prototype.
|
|
98
|
-
|
|
99
|
-
};
|
|
98
|
+
AppICE.prototype.getSdkVersion = function (success, error) {
|
|
99
|
+
cordova.exec(success, error, "AppICEPlugin", "getSdkVersion", []);
|
|
100
|
+
};
|
|
100
101
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
AppICE.prototype.getSdkIntVersion = function (success, error) {
|
|
103
|
+
cordova.exec(success, error, "AppICEPlugin", "getSdkIntVersion", []);
|
|
104
|
+
};
|
|
104
105
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
//==================================
|
|
107
|
+
// DEVICE ID SETTING APIS
|
|
108
|
+
//==================================
|
|
108
109
|
|
|
109
|
-
AppICE.prototype.
|
|
110
|
-
|
|
111
|
-
};
|
|
110
|
+
AppICE.prototype.setDeviceId = function (deviceID, success, error) {
|
|
111
|
+
cordova.exec(success, error, "AppICEPlugin", "setDeviceId", [{ "deviceID": deviceID }]);
|
|
112
|
+
};
|
|
112
113
|
|
|
113
|
-
AppICE.prototype.
|
|
114
|
-
|
|
115
|
-
};
|
|
114
|
+
AppICE.prototype.getDeviceId = function (success, error) {
|
|
115
|
+
cordova.exec(success, error, "AppICEPlugin", "getDeviceId", []);
|
|
116
|
+
};
|
|
116
117
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
118
|
+
AppICE.prototype.getAndroidId = function (success, error) {
|
|
119
|
+
cordova.exec(success, error, "AppICEPlugin", "getAndroidId", []);
|
|
120
|
+
};
|
|
120
121
|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
122
|
+
//===================================
|
|
123
|
+
// ALIAS SETTING APIS
|
|
124
|
+
//===================================
|
|
124
125
|
|
|
125
|
-
AppICE.prototype.
|
|
126
|
-
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
AppICE.prototype.
|
|
138
|
-
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
AppICE.prototype.
|
|
142
|
-
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
AppICE.prototype.
|
|
154
|
-
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
AppICE.prototype.
|
|
166
|
-
|
|
167
|
-
};
|
|
168
|
-
|
|
169
|
-
AppICE.prototype.
|
|
170
|
-
|
|
171
|
-
};
|
|
172
|
-
|
|
173
|
-
AppICE.prototype.
|
|
174
|
-
|
|
175
|
-
};
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
AppICE.prototype.
|
|
186
|
-
|
|
187
|
-
};
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
AppICE.prototype.
|
|
198
|
-
|
|
199
|
-
};
|
|
200
|
-
|
|
201
|
-
AppICE.prototype.
|
|
202
|
-
|
|
203
|
-
};
|
|
204
|
-
|
|
205
|
-
AppICE.prototype.
|
|
206
|
-
|
|
207
|
-
};
|
|
208
|
-
|
|
209
|
-
AppICE.prototype.
|
|
210
|
-
|
|
211
|
-
};
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
AppICE.prototype.
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
126
|
+
AppICE.prototype.setAlias = function (alias, success, error) {
|
|
127
|
+
cordova.exec(success, error, "AppICEPlugin", "setAlias", [{ "alias": alias }]);
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
AppICE.prototype.getAlias = function (success, error) {
|
|
131
|
+
cordova.exec(success, error, "AppICEPlugin", "getAlias", []);
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
//====================================
|
|
135
|
+
// USER SETTING APIS
|
|
136
|
+
//====================================
|
|
137
|
+
|
|
138
|
+
AppICE.prototype.setUser = function (name, phone, email, success, error) {
|
|
139
|
+
cordova.exec(success, error, "AppICEPlugin", "setUser", [{ "name": name, "phone": phone, "email": email }]);
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
AppICE.prototype.getUser = function (success, error) {
|
|
143
|
+
cordova.exec(success, error, "AppICEPlugin", "getUser", []);
|
|
144
|
+
};
|
|
145
|
+
|
|
146
|
+
AppICE.prototype.setUserId = function (userID, success, error) {
|
|
147
|
+
cordova.exec(success, error, "AppICEPlugin", "setUserId", [{ "userID": userID }]);
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
//=============================
|
|
151
|
+
// CHILD KEY SETTING APIS
|
|
152
|
+
//=============================
|
|
153
|
+
|
|
154
|
+
AppICE.prototype.setChildId = function (childID, success, error) {
|
|
155
|
+
cordova.exec(success, error, "AppICEPlugin", "setChildId", [{ "childID": childID }]);
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
AppICE.prototype.getChildId = function (success, error) {
|
|
159
|
+
cordova.exec(success, error, "AppICEPlugin", "getChildId", []);
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
//=========================================
|
|
163
|
+
// CUSTOM VARIBALE AND EVENT SETTING APIS
|
|
164
|
+
//==========================================
|
|
165
|
+
|
|
166
|
+
AppICE.prototype.setCustomVariable = function (key, value, success, error) {
|
|
167
|
+
cordova.exec(success, error, "AppICEPlugin", "setCustomVariable", [{ "key": key, "value": value }]);
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
AppICE.prototype.getCustomVariable = function (key, success, error) {
|
|
171
|
+
cordova.exec(success, error, "AppICEPlugin", "getCustomVariable", [{ "key": key }]);
|
|
172
|
+
};
|
|
173
|
+
|
|
174
|
+
AppICE.prototype.removeCustomVariable = function (key, success, error) {
|
|
175
|
+
cordova.exec(success, error, "AppICEPlugin", "removeCustomVariable", [{ "key": key }]);
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
AppICE.prototype.tagEvent = function (key, data, success, error) {
|
|
179
|
+
cordova.exec(success, error, "AppICEPlugin", "tagEvent", [{ "key": key, "data": data }]);
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
//==================================
|
|
183
|
+
// SESSION SETTING APIS
|
|
184
|
+
//==================================
|
|
185
|
+
|
|
186
|
+
AppICE.prototype.setSessionTimeout = function (timeout, success, error) {
|
|
187
|
+
cordova.exec(success, error, "AppICEPlugin", "setSessionTimeout", [{ "timeout": timeout }]);
|
|
188
|
+
};
|
|
189
|
+
|
|
190
|
+
AppICE.prototype.getSessionTimeout = function (success, error) {
|
|
191
|
+
cordova.exec(success, error, "AppICEPlugin", "getSessionTimeout", []);
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
//==================================
|
|
195
|
+
// PUSH NOTIFICATION SETTING APIS
|
|
196
|
+
//==================================
|
|
197
|
+
|
|
198
|
+
AppICE.prototype.getDeviceToken = function (success, error) {
|
|
199
|
+
cordova.exec(success, error, "AppICEPlugin", "getDeviceToken", []);
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
AppICE.prototype.setSmallIcon = function (icon, success, error) {
|
|
203
|
+
cordova.exec(success, error, "AppICEPlugin", "setSmallIcon", [{ "icon": icon }]);
|
|
204
|
+
};
|
|
205
|
+
|
|
206
|
+
AppICE.prototype.onNotificationOpen = function (success, error) {
|
|
207
|
+
cordova.exec(success, error, "AppICEPlugin", "onNotificationOpen", []);
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
AppICE.prototype.pushNotificationClicked = function (payload, success, error) {
|
|
211
|
+
cordova.exec(success, error, "AppICEPlugin", "pushNotificationClicked", [{ "pushPayload": payload }]);
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
AppICE.prototype.getDeepLinkURL = function (payload, success, error) {
|
|
215
|
+
cordova.exec(success, error, "AppICEPlugin", "getDeepLinkURL", [{ "pushPayload": payload }]);
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
AppICE.prototype.getDataForKey = function (payload, key, success, error) {
|
|
219
|
+
try {
|
|
220
|
+
let parsedPayload;
|
|
221
|
+
|
|
222
|
+
// if payload is a string
|
|
223
|
+
if (typeof payload === 'string') {
|
|
224
|
+
// Parse the payload string to JSON
|
|
225
|
+
parsedPayload = JSON.parse(payload);
|
|
226
|
+
} else {
|
|
227
|
+
// if already an object
|
|
228
|
+
parsedPayload = payload;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
// if key exist then return the value
|
|
232
|
+
if (parsedPayload.hasOwnProperty(key)) {
|
|
233
|
+
success(parsedPayload[key]);
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
// check for active camps in case of who + what payload
|
|
237
|
+
if (parsedPayload.hasOwnProperty('activeCampaigns') && parsedPayload.activeCampaigns.length > 0) {
|
|
238
|
+
const data = parsedPayload.activeCampaigns[0].data;
|
|
239
|
+
if (data && data.hasOwnProperty(key)) {
|
|
240
|
+
success(data[key]);
|
|
241
|
+
}
|
|
242
|
+
// activeCamps => cdata
|
|
243
|
+
if (data && data.hasOwnProperty('cdata') && data.cdata.hasOwnProperty(key)) {
|
|
244
|
+
success(data.cdata[key]);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
if (parsedPayload.hasOwnProperty('cdata') && parsedPayload.cdata.hasOwnProperty(key)) {
|
|
249
|
+
success(parsedPayload.cdata[key]);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
error('something is wrong please try again with valid data');
|
|
253
|
+
} catch (errMessage) {
|
|
254
|
+
error(errMessage)
|
|
238
255
|
}
|
|
239
|
-
|
|
240
|
-
|
|
256
|
+
};
|
|
257
|
+
|
|
258
|
+
//===============================
|
|
259
|
+
// VISUAL PLAYBACK SETTING APIS
|
|
260
|
+
//===============================
|
|
261
|
+
|
|
262
|
+
AppICE.prototype.isSemusiSensing = function (success, error) {
|
|
263
|
+
cordova.exec(success, error, "AppICEPlugin", "isSemusiSensing", []);
|
|
264
|
+
};
|
|
265
|
+
|
|
266
|
+
AppICE.prototype.trackTouchS = function (e, success, error) {
|
|
267
|
+
var touchobj = e.changedTouches[0]
|
|
268
|
+
swipedir = 'none'
|
|
269
|
+
dist = 0
|
|
270
|
+
startX = touchobj.pageX
|
|
271
|
+
startY = touchobj.pageY
|
|
272
|
+
startTime = new Date().getTime()
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
AppICE.prototype.trackTouchE = function (e, success, error) {
|
|
276
|
+
var touchobj = e.changedTouches[0]
|
|
277
|
+
distX = touchobj.pageX - startX
|
|
278
|
+
distY = touchobj.pageY - startY
|
|
279
|
+
elapsedTime = new Date().getTime() - startTime
|
|
280
|
+
if (elapsedTime <= 1500) {
|
|
281
|
+
if (Math.abs(distX) >= 150 && Math.abs(distY) <= 250) {
|
|
282
|
+
swipedir = (distX < 0) ? 'left' : 'right'
|
|
283
|
+
}
|
|
284
|
+
else if (Math.abs(distY) >= 150 && Math.abs(distX) <= 250) {
|
|
285
|
+
swipedir = (distY < 0) ? 'up' : 'down'
|
|
286
|
+
}
|
|
241
287
|
}
|
|
242
|
-
}
|
|
243
288
|
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
289
|
+
var inputArr = [];
|
|
290
|
+
var inputs = document.getElementsByTagName('input');
|
|
291
|
+
for (var index = 0; index < inputs.length; ++index) {
|
|
292
|
+
var element = inputs[index];
|
|
293
|
+
var data = {
|
|
294
|
+
"t": element.tagName,
|
|
295
|
+
"i": element.id,
|
|
296
|
+
"n": element.name,
|
|
297
|
+
"y": element.getBoundingClientRect().top + window.scrollY,
|
|
298
|
+
"x": element.getBoundingClientRect().left + window.scrollX,
|
|
299
|
+
"w": element.getBoundingClientRect().width,
|
|
300
|
+
"h": element.getBoundingClientRect().height
|
|
301
|
+
};
|
|
302
|
+
inputArr.push(data);
|
|
303
|
+
}
|
|
259
304
|
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
};
|
|
268
|
-
|
|
269
|
-
AppICE.prototype.trackScreens = function (e, success, error) {
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
};
|
|
305
|
+
if (swipedir == 'none') {
|
|
306
|
+
var t = e.target;
|
|
307
|
+
cordova.exec(success, error, "AppICEPlugin", "trackTouches", [{ "type": t.tagName, "id": t.id, "name": t.name, "py": t.getBoundingClientRect().top + window.scrollY, "px": t.getBoundingClientRect().left + window.scrollX, "pw": t.getBoundingClientRect().width, "ph": t.getBoundingClientRect().height, "x": touchobj.screenX, "y": touchobj.screenY, "h": document.documentElement.clientHeight, "w": document.documentElement.clientWidth, "arr": inputArr }]);
|
|
308
|
+
}
|
|
309
|
+
else {
|
|
310
|
+
cordova.exec(success, error, "AppICEPlugin", "trackSwipes", [{ "type": swipedir, "x1": startX, "y1": startY, "x2": touchobj.screenX, "y2": touchobj.screenY, "h": document.documentElement.clientHeight, "w": document.documentElement.clientWidth, "arr": inputArr }]);
|
|
311
|
+
}
|
|
312
|
+
};
|
|
313
|
+
|
|
314
|
+
AppICE.prototype.trackScreens = function (e, success, error) {
|
|
315
|
+
var inputArr = [];
|
|
316
|
+
var inputs = document.getElementsByTagName('input');
|
|
317
|
+
for (var index = 0; index < inputs.length; ++index) {
|
|
318
|
+
var element = inputs[index];
|
|
319
|
+
var data = {
|
|
320
|
+
"t": element.tagName,
|
|
321
|
+
"i": element.id,
|
|
322
|
+
"n": element.name,
|
|
323
|
+
"y": element.getBoundingClientRect().top + window.scrollY,
|
|
324
|
+
"x": element.getBoundingClientRect().left + window.scrollX,
|
|
325
|
+
"w": element.getBoundingClientRect().width,
|
|
326
|
+
"h": element.getBoundingClientRect().height
|
|
327
|
+
};
|
|
328
|
+
inputArr.push(data);
|
|
329
|
+
}
|
|
330
|
+
cordova.exec(success, error, "AppICEPlugin", "trackScreens", [{ "old": e.oldURL, "new": e.newURL, "loc": location.hash, "h": document.documentElement.clientHeight, "w": document.documentElement.clientWidth, "arr": inputArr }]);
|
|
331
|
+
};
|
|
332
|
+
|
|
333
|
+
module.exports = new AppICE();
|
|
287
334
|
|
|
288
|
-
module.exports = new AppICE();
|
|
289
335
|
|
|
336
|
+
});
|