forked from Hybrid-Force/cordova-plugin-leancloud
-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathLeanAnalytics.js
38 lines (31 loc) · 1.39 KB
/
LeanAnalytics.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
var exec = require('cordova/exec');
module.exports = {
onViewStart: function(viewId, success, error) {
console.log('onViewStart', viewId);
exec(success, error, "LeanAnalytics", "onViewStart", [viewId]);
},
onViewEnd: function(viewId, success, error) {
console.log('onViewEnd', viewId);
exec(success, error, "LeanAnalytics", "onViewEnd", [viewId]);
},
event: function(eventId, label, success, error) {
console.log('event', eventId, label);
exec(success, error, "LeanAnalytics", "event", [eventId, label]);
},
onEventStart: function(eventId, label, success, error) {
console.log('onEventStart', eventId, label);
exec(success, error, "LeanAnalytics", "onEventStart", [eventId, label]);
},
onEventEnd: function(eventId, label, success, error) {
console.log('onEventEnd', eventId, label);
exec(success, error, "LeanAnalytics", "onEventEnd", [eventId, label]);
},
onKVEventStart: function(eventId, key, attr, value, success, error) {
console.log('onKVEventStart', eventId, key, attr, value);
exec(success, error, "LeanAnalytics", "onKVEventStart", [eventId, key, attr, value]);
},
onKVEventEnd: function(eventId, key, success, error) {
console.log('onKVEventEnd', eventId, key);
exec(success, error, "LeanAnalytics", "onKVEventEnd", [eventId, key]);
}
};