cordova-plugin-appice 2.0.9 → 2.1.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/README.md +0 -2
- package/example/config.xml +59 -59
- package/example/package.json +38 -38
- package/example/res/ai_android.pem +40 -40
- package/example/www/css/index.css +116 -116
- package/example/www/index.html +62 -62
- package/example/www/js/index.js +111 -102
- package/package.json +20 -2
- package/plugin.xml +193 -128
- package/scripts/BeforeAndroidBuilt.js +165 -102
- package/scripts/BeforeIosBuilt.js +35 -35
- package/scripts/androidAfterPluginAdd.js +67 -67
- package/scripts/androidAfterPluginRm.js +112 -112
- package/scripts/iOSAfterPluginAdd.js +58 -58
- package/scripts/iOSAfterPluginRm.js +30 -31
- package/src/android/AppICEFCMPush.java +26 -0
- package/src/android/AppICEMFPPush.java +67 -0
- package/{libcordova/src/main/java/com/appice/cordova → src/android}/AppICEPlugin.java +984 -968
- package/src/android/AppICEPushHandler.java +163 -0
- package/{libcordova/src/main/java/com/appice/cordova → src/android}/CampaignCampsReceiver.java +94 -95
- package/{libcordova/src/main/java/com/appice/cordova → src/android}/NotificationEventService.java +64 -55
- package/src/build.gradle +4 -2
- package/src/ios/AppDelegate+AppICEPlugin.m +178 -89
- package/src/ios/AppICEPlugin.h +3 -0
- package/src/ios/AppICEPlugin.m +55 -10
- package/www/AppICE.js +261 -228
- package/libcordova/android-release-aar.gradle +0 -63
- package/libcordova/build.gradle +0 -50
- package/libcordova/cordova.jar +0 -0
- package/libcordova/proguard-rules.pro +0 -21
- package/libcordova/src/main/AndroidManifest.xml +0 -24
- package/libcordova/src/main/res/values/strings.xml +0 -3
- package/src/firebase/modified/modified.iml +0 -11
- package/src/firebase/original/original.iml +0 -11
package/www/AppICE.js
CHANGED
|
@@ -1,284 +1,317 @@
|
|
|
1
|
-
cordova.define("cordova-plugin-appice.AppICE", function(require, exports, module) {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
AppICE.prototype.validateIntegration = function(success, error) {
|
|
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) {
|
|
12
11
|
cordova.exec(success, error, "AppICEPlugin", "validateIntegration", []);
|
|
13
12
|
};
|
|
14
|
-
|
|
15
|
-
AppICE.prototype.startContext = function(gcmID, success, error) {
|
|
16
|
-
cordova.exec(success, error, "AppICEPlugin", "startContext", [{"gcmID":gcmID}]);
|
|
17
|
-
|
|
13
|
+
|
|
14
|
+
AppICE.prototype.startContext = function (gcmID, success, error) {
|
|
15
|
+
cordova.exec(success, error, "AppICEPlugin", "startContext", [{ "gcmID": gcmID }]);
|
|
16
|
+
|
|
18
17
|
var inputArr = [];
|
|
19
18
|
var inputs = document.getElementsByTagName('input');
|
|
20
19
|
for (var index = 0; index < inputs.length; ++index) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
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);
|
|
32
31
|
}
|
|
33
|
-
|
|
32
|
+
|
|
34
33
|
cordova.exec(success, error, "AppICEPlugin", "trackScreens",
|
|
35
|
-
|
|
34
|
+
[{ "old": "", "new": "", "loc": location.hash, "h": document.documentElement.clientHeight, "w": document.documentElement.clientWidth, "arr": inputArr }]);
|
|
36
35
|
};
|
|
37
|
-
|
|
38
|
-
|
|
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
39
|
var inputArr = [];
|
|
40
40
|
var inputs = document.getElementsByTagName('input');
|
|
41
41
|
for (var index = 0; index < inputs.length; ++index) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
AppICE.prototype.stopContext = function(success, error) {
|
|
59
|
-
cordova.exec(success, error, "AppICEPlugin", "stopContext", []);
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
AppICE.prototype.isSemusiSensing = function(success, error) {
|
|
63
|
-
cordova.exec(success, error, "AppICEPlugin", "isSemusiSensing", []);
|
|
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
|
+
}
|
|
54
|
+
|
|
55
|
+
cordova.exec(success, error, "AppICEPlugin", "trackScreens", [{ "old": "", "new": "", "loc": location.hash, "h": document.documentElement.clientHeight, "w": document.documentElement.clientWidth, "arr": inputArr }]);
|
|
64
56
|
};
|
|
65
|
-
|
|
66
|
-
AppICE.prototype.
|
|
67
|
-
cordova.exec(success, error, "AppICEPlugin", "
|
|
57
|
+
|
|
58
|
+
AppICE.prototype.stopContext = function (success, error) {
|
|
59
|
+
cordova.exec(success, error, "AppICEPlugin", "stopContext", []);
|
|
68
60
|
};
|
|
69
|
-
|
|
70
|
-
AppICE.prototype.
|
|
71
|
-
cordova.exec(success, error, "AppICEPlugin", "
|
|
61
|
+
|
|
62
|
+
AppICE.prototype.getCurrentContext = function (success, error) {
|
|
63
|
+
cordova.exec(success, error, "AppICEPlugin", "getCurrentContext", []);
|
|
72
64
|
};
|
|
73
|
-
|
|
74
|
-
AppICE.prototype.
|
|
75
|
-
cordova.exec(success, error, "AppICEPlugin", "
|
|
65
|
+
|
|
66
|
+
AppICE.prototype.registerLifeCycle = function (success, error) {
|
|
67
|
+
cordova.exec(success, error, "AppICEPlugin", "registerLifeCycle", []);
|
|
76
68
|
};
|
|
77
|
-
|
|
78
|
-
|
|
69
|
+
|
|
70
|
+
//==================================
|
|
71
|
+
// PLAY STORE SETTING APIS
|
|
72
|
+
//==================================
|
|
73
|
+
|
|
74
|
+
AppICE.prototype.openPlayServiceUpdate = function (success, error) {
|
|
79
75
|
cordova.exec(success, error, "AppICEPlugin", "openPlayServiceUpdate", []);
|
|
80
76
|
};
|
|
81
|
-
|
|
82
|
-
|
|
77
|
+
|
|
78
|
+
//===================================
|
|
79
|
+
// SDK METADATA APIS
|
|
80
|
+
//===================================
|
|
81
|
+
|
|
82
|
+
AppICE.prototype.getAppKey = function (success, error) {
|
|
83
|
+
cordova.exec(success, error, "AppICEPlugin", "getAppKey", []);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
AppICE.prototype.getApiKey = function (success, error) {
|
|
87
|
+
cordova.exec(success, error, "AppICEPlugin", "getApiKey", []);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
AppICE.prototype.getAppId = function (success, error) {
|
|
91
|
+
cordova.exec(success, error, "AppICEPlugin", "getAppId", []);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
AppICE.prototype.getSdkVersion = function (success, error) {
|
|
83
95
|
cordova.exec(success, error, "AppICEPlugin", "getSdkVersion", []);
|
|
84
96
|
};
|
|
85
|
-
|
|
86
|
-
AppICE.prototype.getSdkIntVersion = function(success, error) {
|
|
97
|
+
|
|
98
|
+
AppICE.prototype.getSdkIntVersion = function (success, error) {
|
|
87
99
|
cordova.exec(success, error, "AppICEPlugin", "getSdkIntVersion", []);
|
|
88
100
|
};
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
101
|
+
|
|
102
|
+
//==================================
|
|
103
|
+
// DEVICE ID SETTING APIS
|
|
104
|
+
//==================================
|
|
105
|
+
|
|
106
|
+
AppICE.prototype.setDeviceId = function (deviceID, success, error) {
|
|
107
|
+
cordova.exec(success, error, "AppICEPlugin", "setDeviceId", [{ "deviceID": deviceID }]);
|
|
92
108
|
};
|
|
93
|
-
|
|
94
|
-
AppICE.prototype.getDeviceId = function(success, error) {
|
|
109
|
+
|
|
110
|
+
AppICE.prototype.getDeviceId = function (success, error) {
|
|
95
111
|
cordova.exec(success, error, "AppICEPlugin", "getDeviceId", []);
|
|
96
112
|
};
|
|
97
|
-
|
|
98
|
-
AppICE.prototype.getAndroidId = function(success, error) {
|
|
113
|
+
|
|
114
|
+
AppICE.prototype.getAndroidId = function (success, error) {
|
|
99
115
|
cordova.exec(success, error, "AppICEPlugin", "getAndroidId", []);
|
|
100
116
|
};
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
AppICE.prototype.
|
|
107
|
-
cordova.exec(success, error, "AppICEPlugin", "
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
AppICE.prototype.getAppId = function(success, error) {
|
|
111
|
-
cordova.exec(success, error, "AppICEPlugin", "getAppId", []);
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
AppICE.prototype.getCurrentContext = function(success, error) {
|
|
115
|
-
cordova.exec(success, error, "AppICEPlugin", "getCurrentContext", []);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
AppICE.prototype.setAlias = function(alias, success, error) {
|
|
119
|
-
cordova.exec(success, error, "AppICEPlugin", "setAlias", [{"alias":alias}]);
|
|
117
|
+
|
|
118
|
+
//===================================
|
|
119
|
+
// ALIAS SETTING APIS
|
|
120
|
+
//===================================
|
|
121
|
+
|
|
122
|
+
AppICE.prototype.setAlias = function (alias, success, error) {
|
|
123
|
+
cordova.exec(success, error, "AppICEPlugin", "setAlias", [{ "alias": alias }]);
|
|
120
124
|
};
|
|
121
|
-
|
|
122
|
-
AppICE.prototype.getAlias = function(success, error) {
|
|
125
|
+
|
|
126
|
+
AppICE.prototype.getAlias = function (success, error) {
|
|
123
127
|
cordova.exec(success, error, "AppICEPlugin", "getAlias", []);
|
|
124
128
|
};
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
129
|
+
|
|
130
|
+
//====================================
|
|
131
|
+
// USER SETTING APIS
|
|
132
|
+
//====================================
|
|
133
|
+
|
|
134
|
+
AppICE.prototype.setUser = function (name, phone, email, success, error) {
|
|
135
|
+
cordova.exec(success, error, "AppICEPlugin", "setUser", [{ "name": name, "phone": phone, "email": email }]);
|
|
128
136
|
};
|
|
129
|
-
|
|
130
|
-
AppICE.prototype.getUser = function(success, error) {
|
|
137
|
+
|
|
138
|
+
AppICE.prototype.getUser = function (success, error) {
|
|
131
139
|
cordova.exec(success, error, "AppICEPlugin", "getUser", []);
|
|
132
140
|
};
|
|
133
|
-
|
|
134
|
-
AppICE.prototype.
|
|
135
|
-
cordova.exec(success, error, "AppICEPlugin", "
|
|
141
|
+
|
|
142
|
+
AppICE.prototype.setUserId = function (userID, success, error) {
|
|
143
|
+
cordova.exec(success, error, "AppICEPlugin", "setUserId", [{ "userID": userID }]);
|
|
136
144
|
};
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
145
|
+
|
|
146
|
+
//=============================
|
|
147
|
+
// CHILD KEY SETTING APIS
|
|
148
|
+
//=============================
|
|
149
|
+
|
|
150
|
+
AppICE.prototype.setChildId = function (childID, success, error) {
|
|
151
|
+
cordova.exec(success, error, "AppICEPlugin", "setChildId", [{ "childID": childID }]);
|
|
140
152
|
};
|
|
141
|
-
|
|
142
|
-
AppICE.prototype.
|
|
143
|
-
cordova.exec(success, error, "AppICEPlugin", "
|
|
153
|
+
|
|
154
|
+
AppICE.prototype.getChildId = function (success, error) {
|
|
155
|
+
cordova.exec(success, error, "AppICEPlugin", "getChildId", []);
|
|
144
156
|
};
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
157
|
+
|
|
158
|
+
//=========================================
|
|
159
|
+
// CUSTOM VARIBALE AND EVENT SETTING APIS
|
|
160
|
+
//==========================================
|
|
161
|
+
|
|
162
|
+
AppICE.prototype.setCustomVariable = function (key, value, success, error) {
|
|
163
|
+
cordova.exec(success, error, "AppICEPlugin", "setCustomVariable", [{ "key": key, "value": value }]);
|
|
148
164
|
};
|
|
149
|
-
|
|
150
|
-
AppICE.prototype.
|
|
151
|
-
cordova.exec(success, error, "AppICEPlugin", "
|
|
165
|
+
|
|
166
|
+
AppICE.prototype.getCustomVariable = function (key, success, error) {
|
|
167
|
+
cordova.exec(success, error, "AppICEPlugin", "getCustomVariable", [{ "key": key }]);
|
|
152
168
|
};
|
|
153
|
-
|
|
154
|
-
AppICE.prototype.
|
|
155
|
-
cordova.exec(success, error, "AppICEPlugin", "
|
|
169
|
+
|
|
170
|
+
AppICE.prototype.removeCustomVariable = function (key, success, error) {
|
|
171
|
+
cordova.exec(success, error, "AppICEPlugin", "removeCustomVariable", [{ "key": key }]);
|
|
156
172
|
};
|
|
157
|
-
|
|
158
|
-
AppICE.prototype.
|
|
159
|
-
cordova.exec(success, error, "AppICEPlugin", "
|
|
173
|
+
|
|
174
|
+
AppICE.prototype.tagEvent = function (key, data, success, error) {
|
|
175
|
+
cordova.exec(success, error, "AppICEPlugin", "tagEvent", [{ "key": key, "data": data }]);
|
|
160
176
|
};
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
177
|
+
|
|
178
|
+
//==================================
|
|
179
|
+
// SESSION SETTING APIS
|
|
180
|
+
//==================================
|
|
181
|
+
|
|
182
|
+
AppICE.prototype.setSessionTimeout = function (timeout, success, error) {
|
|
183
|
+
cordova.exec(success, error, "AppICEPlugin", "setSessionTimeout", [{ "timeout": timeout }]);
|
|
164
184
|
};
|
|
165
|
-
|
|
166
|
-
AppICE.prototype.
|
|
167
|
-
cordova.exec(success, error, "AppICEPlugin", "
|
|
185
|
+
|
|
186
|
+
AppICE.prototype.getSessionTimeout = function (success, error) {
|
|
187
|
+
cordova.exec(success, error, "AppICEPlugin", "getSessionTimeout", []);
|
|
168
188
|
};
|
|
169
|
-
|
|
170
|
-
|
|
189
|
+
|
|
190
|
+
//==================================
|
|
191
|
+
// PUSH NOTIFICATION SETTING APIS
|
|
192
|
+
//==================================
|
|
193
|
+
|
|
194
|
+
AppICE.prototype.getDeviceToken = function (success, error) {
|
|
171
195
|
cordova.exec(success, error, "AppICEPlugin", "getDeviceToken", []);
|
|
172
196
|
};
|
|
173
|
-
|
|
174
|
-
AppICE.prototype.
|
|
175
|
-
cordova.exec(success, error, "AppICEPlugin", "
|
|
176
|
-
};
|
|
177
|
-
|
|
178
|
-
AppICE.prototype.getCustomVariable = function(key, success, error) {
|
|
179
|
-
cordova.exec(success, error, "AppICEPlugin", "getCustomVariable", [{"key":key}]);
|
|
197
|
+
|
|
198
|
+
AppICE.prototype.setSmallIcon = function (icon, success, error) {
|
|
199
|
+
cordova.exec(success, error, "AppICEPlugin", "setSmallIcon", [{ "icon": icon }]);
|
|
180
200
|
};
|
|
181
|
-
|
|
182
|
-
AppICE.prototype.
|
|
183
|
-
cordova.exec(success, error, "AppICEPlugin", "
|
|
201
|
+
|
|
202
|
+
AppICE.prototype.onNotificationOpen = function (success, error) {
|
|
203
|
+
cordova.exec(success, error, "AppICEPlugin", "onNotificationOpen", []);
|
|
184
204
|
};
|
|
185
|
-
|
|
186
|
-
AppICE.prototype.
|
|
187
|
-
cordova.exec(success, error, "AppICEPlugin", "
|
|
205
|
+
|
|
206
|
+
AppICE.prototype.pushNotificationClicked = function (payload, success, error) {
|
|
207
|
+
cordova.exec(success, error, "AppICEPlugin", "pushNotificationClicked", [{ "pushPayload": payload }]);
|
|
188
208
|
};
|
|
189
|
-
|
|
190
|
-
AppICE.prototype.
|
|
191
|
-
cordova.exec(success, error, "AppICEPlugin", "
|
|
209
|
+
|
|
210
|
+
AppICE.prototype.getDeepLinkURL = function (payload, success, error) {
|
|
211
|
+
cordova.exec(success, error, "AppICEPlugin", "getDeepLinkURL", [{ "pushPayload": payload }]);
|
|
192
212
|
};
|
|
193
|
-
|
|
194
|
-
AppICE.prototype.
|
|
195
|
-
|
|
213
|
+
|
|
214
|
+
AppICE.prototype.getDataForKey = function (payload, key, success, error) {
|
|
215
|
+
try {
|
|
216
|
+
let parsedPayload;
|
|
217
|
+
|
|
218
|
+
// Check if payload is a string
|
|
219
|
+
if (typeof payload === 'string') {
|
|
220
|
+
// Parse the payload string to JSON
|
|
221
|
+
parsedPayload = JSON.parse(payload);
|
|
222
|
+
} else {
|
|
223
|
+
// Use the payload directly if it's already an object
|
|
224
|
+
parsedPayload = payload;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// Check if the key exists in the payload
|
|
228
|
+
if (parsedPayload.hasOwnProperty(key)) {
|
|
229
|
+
// Extract the value and return it
|
|
230
|
+
const value = parsedPayload[key];
|
|
231
|
+
success(value);
|
|
232
|
+
}
|
|
233
|
+
} catch (error) {
|
|
234
|
+
error(error)
|
|
235
|
+
}
|
|
236
|
+
|
|
196
237
|
};
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
238
|
+
|
|
239
|
+
//===============================
|
|
240
|
+
// VISUAL PLAYBACK SETTING APIS
|
|
241
|
+
//===============================
|
|
242
|
+
|
|
243
|
+
AppICE.prototype.isSemusiSensing = function (success, error) {
|
|
244
|
+
cordova.exec(success, error, "AppICEPlugin", "isSemusiSensing", []);
|
|
200
245
|
};
|
|
201
|
-
|
|
202
|
-
AppICE.prototype.
|
|
203
|
-
|
|
246
|
+
|
|
247
|
+
AppICE.prototype.trackTouchS = function (e, success, error) {
|
|
248
|
+
var touchobj = e.changedTouches[0]
|
|
249
|
+
swipedir = 'none'
|
|
250
|
+
dist = 0
|
|
251
|
+
startX = touchobj.pageX
|
|
252
|
+
startY = touchobj.pageY
|
|
253
|
+
startTime = new Date().getTime()
|
|
204
254
|
};
|
|
205
255
|
|
|
206
|
-
AppICE.prototype.
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
dist = 0
|
|
215
|
-
startX = touchobj.pageX
|
|
216
|
-
startY = touchobj.pageY
|
|
217
|
-
startTime = new Date().getTime()
|
|
218
|
-
};
|
|
219
|
-
|
|
220
|
-
AppICE.prototype.trackTouchE = function(e, success, error) {
|
|
221
|
-
var touchobj = e.changedTouches[0]
|
|
222
|
-
distX = touchobj.pageX - startX
|
|
223
|
-
distY = touchobj.pageY - startY
|
|
224
|
-
elapsedTime = new Date().getTime() - startTime
|
|
225
|
-
if (elapsedTime <= 1500) {
|
|
226
|
-
if (Math.abs(distX) >= 150 && Math.abs(distY) <= 250) {
|
|
227
|
-
swipedir = (distX < 0)? 'left' : 'right'
|
|
228
|
-
}
|
|
229
|
-
else if (Math.abs(distY) >= 150 && Math.abs(distX) <= 250) {
|
|
230
|
-
swipedir = (distY < 0)? 'up' : 'down'
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
|
|
234
|
-
// console.log('swipe : ' + swipedir + ' , distX: ' + distX + ' , distY: ' + distY);
|
|
235
|
-
|
|
236
|
-
var inputArr = [];
|
|
237
|
-
var inputs = document.getElementsByTagName('input');
|
|
238
|
-
for (var index = 0; index < inputs.length; ++index) {
|
|
239
|
-
var element = inputs[index];
|
|
240
|
-
var data = {
|
|
241
|
-
"t":element.tagName,
|
|
242
|
-
"i":element.id,
|
|
243
|
-
"n":element.name,
|
|
244
|
-
"y":element.getBoundingClientRect().top + window.scrollY,
|
|
245
|
-
"x":element.getBoundingClientRect().left + window.scrollX,
|
|
246
|
-
"w":element.getBoundingClientRect().width,
|
|
247
|
-
"h":element.getBoundingClientRect().height
|
|
248
|
-
};
|
|
249
|
-
inputArr.push(data);
|
|
256
|
+
AppICE.prototype.trackTouchE = function (e, success, error) {
|
|
257
|
+
var touchobj = e.changedTouches[0]
|
|
258
|
+
distX = touchobj.pageX - startX
|
|
259
|
+
distY = touchobj.pageY - startY
|
|
260
|
+
elapsedTime = new Date().getTime() - startTime
|
|
261
|
+
if (elapsedTime <= 1500) {
|
|
262
|
+
if (Math.abs(distX) >= 150 && Math.abs(distY) <= 250) {
|
|
263
|
+
swipedir = (distX < 0) ? 'left' : 'right'
|
|
250
264
|
}
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
var t = e.target;
|
|
254
|
-
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}]);
|
|
255
|
-
}
|
|
256
|
-
else {
|
|
257
|
-
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}]);
|
|
265
|
+
else if (Math.abs(distY) >= 150 && Math.abs(distX) <= 250) {
|
|
266
|
+
swipedir = (distY < 0) ? 'up' : 'down'
|
|
258
267
|
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
var inputArr = [];
|
|
271
|
+
var inputs = document.getElementsByTagName('input');
|
|
272
|
+
for (var index = 0; index < inputs.length; ++index) {
|
|
273
|
+
var element = inputs[index];
|
|
274
|
+
var data = {
|
|
275
|
+
"t": element.tagName,
|
|
276
|
+
"i": element.id,
|
|
277
|
+
"n": element.name,
|
|
278
|
+
"y": element.getBoundingClientRect().top + window.scrollY,
|
|
279
|
+
"x": element.getBoundingClientRect().left + window.scrollX,
|
|
280
|
+
"w": element.getBoundingClientRect().width,
|
|
281
|
+
"h": element.getBoundingClientRect().height
|
|
282
|
+
};
|
|
283
|
+
inputArr.push(data);
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
if (swipedir == 'none') {
|
|
287
|
+
var t = e.target;
|
|
288
|
+
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 }]);
|
|
289
|
+
}
|
|
290
|
+
else {
|
|
291
|
+
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 }]);
|
|
292
|
+
}
|
|
259
293
|
};
|
|
260
|
-
|
|
261
|
-
AppICE.prototype.trackScreens = function(e, success, error) {
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
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}]);
|
|
294
|
+
|
|
295
|
+
AppICE.prototype.trackScreens = function (e, success, error) {
|
|
296
|
+
var inputArr = [];
|
|
297
|
+
var inputs = document.getElementsByTagName('input');
|
|
298
|
+
for (var index = 0; index < inputs.length; ++index) {
|
|
299
|
+
var element = inputs[index];
|
|
300
|
+
var data = {
|
|
301
|
+
"t": element.tagName,
|
|
302
|
+
"i": element.id,
|
|
303
|
+
"n": element.name,
|
|
304
|
+
"y": element.getBoundingClientRect().top + window.scrollY,
|
|
305
|
+
"x": element.getBoundingClientRect().left + window.scrollX,
|
|
306
|
+
"w": element.getBoundingClientRect().width,
|
|
307
|
+
"h": element.getBoundingClientRect().height
|
|
308
|
+
};
|
|
309
|
+
inputArr.push(data);
|
|
310
|
+
}
|
|
311
|
+
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 }]);
|
|
279
312
|
};
|
|
280
|
-
|
|
313
|
+
|
|
281
314
|
module.exports = new AppICE();
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
315
|
+
|
|
316
|
+
|
|
317
|
+
});
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
// ./gradlew clean build generateRelease
|
|
2
|
-
apply plugin: 'maven'
|
|
3
|
-
|
|
4
|
-
def groupId = project.PUBLISH_GROUP_ID
|
|
5
|
-
def artifactId = project.PUBLISH_ARTIFACT_ID
|
|
6
|
-
def version = project.PUBLISH_VERSION
|
|
7
|
-
|
|
8
|
-
def localReleaseDest = "${buildDir}/release/${version}"
|
|
9
|
-
|
|
10
|
-
task androidJavadocs(type: Javadoc) {
|
|
11
|
-
source = android.sourceSets.main.java.srcDirs
|
|
12
|
-
ext.androidJar = "${android.sdkDirectory}/platforms/${android.compileSdkVersion}/android.jar"
|
|
13
|
-
classpath += files(ext.androidJar)
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
task androidJavadocsJar(type: Jar, dependsOn: androidJavadocs) {
|
|
17
|
-
classifier = 'javadoc'
|
|
18
|
-
// from androidJavadocs.destinationDir
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
task androidSourcesJar(type: Jar) {
|
|
22
|
-
classifier = 'sources'
|
|
23
|
-
// from android.sourceSets.main.java.srcDirs
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
uploadArchives {
|
|
27
|
-
repositories.mavenDeployer {
|
|
28
|
-
pom.groupId = groupId
|
|
29
|
-
pom.artifactId = artifactId
|
|
30
|
-
pom.version = version
|
|
31
|
-
// Add other pom properties here if you want (developer details / licenses)
|
|
32
|
-
repository(url: "file://${localReleaseDest}")
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
task zipRelease(type: Zip) {
|
|
37
|
-
from localReleaseDest
|
|
38
|
-
destinationDir buildDir
|
|
39
|
-
archiveName "release-${version}.zip"
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
task generateRelease {
|
|
43
|
-
println "Release ${version} can be found at ${localReleaseDest}/"
|
|
44
|
-
println "Release ${version} zipped can be found ${buildDir}/release-${version}.zip"
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
generateRelease.dependsOn(uploadArchives)
|
|
48
|
-
generateRelease.dependsOn(zipRelease)
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
artifacts {
|
|
52
|
-
archives androidSourcesJar
|
|
53
|
-
archives androidJavadocsJar
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
//def installer = install.repositories.mavenInstaller
|
|
57
|
-
def deployer = uploadArchives.repositories.mavenDeployer
|
|
58
|
-
|
|
59
|
-
//[deployer]*.pom*.whenConfigured {
|
|
60
|
-
// pom -> pom.dependencies.find {dep -> dep.groupId == 'appice.io.android' && dep.artifactId == 'sdk' }.optional = true
|
|
61
|
-
//}
|
|
62
|
-
|
|
63
|
-
tasks.findByPath(":libcordova:androidJavadocs").enabled = false
|
package/libcordova/build.gradle
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
apply plugin: 'com.android.library'
|
|
2
|
-
|
|
3
|
-
ext {
|
|
4
|
-
PUBLISH_GROUP_ID = 'appice.io.android'
|
|
5
|
-
PUBLISH_ARTIFACT_ID = 'cordova'
|
|
6
|
-
PUBLISH_VERSION = '2.5.47'
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
android {
|
|
10
|
-
compileSdkVersion 31
|
|
11
|
-
|
|
12
|
-
defaultConfig {
|
|
13
|
-
minSdkVersion 14
|
|
14
|
-
targetSdkVersion 31
|
|
15
|
-
versionCode 1
|
|
16
|
-
versionName "1.0"
|
|
17
|
-
consumerProguardFiles 'proguard-rules.pro'
|
|
18
|
-
}
|
|
19
|
-
buildTypes {
|
|
20
|
-
release {
|
|
21
|
-
minifyEnabled false
|
|
22
|
-
useProguard false
|
|
23
|
-
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
24
|
-
}
|
|
25
|
-
debug {
|
|
26
|
-
minifyEnabled false
|
|
27
|
-
useProguard false
|
|
28
|
-
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
lintOptions {
|
|
32
|
-
abortOnError false
|
|
33
|
-
}
|
|
34
|
-
buildToolsVersion '29.0.3'
|
|
35
|
-
compileOptions {
|
|
36
|
-
sourceCompatibility JavaVersion.VERSION_1_8
|
|
37
|
-
targetCompatibility JavaVersion.VERSION_1_8
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
dependencies {
|
|
42
|
-
implementation fileTree(include: ['*.jar'], dir: 'libs')
|
|
43
|
-
implementation 'androidx.appcompat:appcompat:1.1.0'
|
|
44
|
-
|
|
45
|
-
compileOnly files('cordova.jar')
|
|
46
|
-
|
|
47
|
-
implementation 'com.gitlab.grp_appice:src_android_appice-sdk:2.5.50'
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
apply from: 'android-release-aar.gradle'
|