@steedos/service-ui 2.5.13-beta.21 → 2.5.13-beta.22
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.
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
if (Meteor.isCordova) {
|
|
2
|
+
Meteor.startup(function () {
|
|
3
|
+
const hasRegister = function () {
|
|
4
|
+
let has = false;
|
|
5
|
+
if (Push.push.handlers.notification && Push.push.handlers.notification.length > 0) {
|
|
6
|
+
Push.push.handlers.notification.forEach(function (handler) {
|
|
7
|
+
if (handler.toString().indexOf('push.setApplicationIconBadgeNumber') > 0) {
|
|
8
|
+
has = true
|
|
9
|
+
}
|
|
10
|
+
})
|
|
11
|
+
}
|
|
12
|
+
return has;
|
|
13
|
+
}
|
|
14
|
+
document.addEventListener("deviceready", function () {
|
|
15
|
+
return window.setTimeout(function () {
|
|
16
|
+
var ref, ref1;
|
|
17
|
+
|
|
18
|
+
if (hasRegister() == true) {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
console.log('app注册push失败, 由client js注册push')
|
|
22
|
+
Push.push.on("notification", function (data) {
|
|
23
|
+
var host, path;
|
|
24
|
+
if (data.additionalData.foreground === true) {
|
|
25
|
+
if (data.count > -1) {
|
|
26
|
+
push.setApplicationIconBadgeNumber(
|
|
27
|
+
function () { },
|
|
28
|
+
function () { },
|
|
29
|
+
data.count
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
if (typeof data.additionalData.ejson === "string") {
|
|
35
|
+
data.additionalData.ejson = JSON.parse(data.additionalData.ejson);
|
|
36
|
+
}
|
|
37
|
+
host = data.additionalData.ejson.host;
|
|
38
|
+
if (host == null) {
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
host = host.replace(/\/$/, "");
|
|
42
|
+
if (Servers.serverExists(host) !== true) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
window.AUTOLOAD = false;
|
|
46
|
+
if (data.additionalData.ejson.url) {
|
|
47
|
+
return FlowRouter.go(data.additionalData.ejson.url);
|
|
48
|
+
} else {
|
|
49
|
+
path = "";
|
|
50
|
+
if (
|
|
51
|
+
data.additionalData.ejson.space &&
|
|
52
|
+
data.additionalData.ejson.instance
|
|
53
|
+
) {
|
|
54
|
+
path =
|
|
55
|
+
"workflow/space/" +
|
|
56
|
+
data.additionalData.ejson.space +
|
|
57
|
+
"/inbox/" +
|
|
58
|
+
data.additionalData.ejson.instance;
|
|
59
|
+
}
|
|
60
|
+
navigator.splashscreen.hide();
|
|
61
|
+
if (window.Session && window.Session.get("spaceId")) {
|
|
62
|
+
return FlowRouter.go("/" + path);
|
|
63
|
+
} else {
|
|
64
|
+
return Servers.startServer(host, path, function (err, url) {
|
|
65
|
+
if (err != null) {
|
|
66
|
+
return console.log(err);
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
if (
|
|
73
|
+
((ref = device.manufacturer) != null ? ref.toLowerCase() : void 0) ===
|
|
74
|
+
"huawei" &&
|
|
75
|
+
cordova.plugins.huaweipush
|
|
76
|
+
) {
|
|
77
|
+
cordova.plugins.huaweipush.init();
|
|
78
|
+
return document.addEventListener(
|
|
79
|
+
"huaweipush.receiveRegisterResult",
|
|
80
|
+
function (event) {
|
|
81
|
+
var registrationId;
|
|
82
|
+
console.log(event);
|
|
83
|
+
registrationId = "huawei:" + event.token;
|
|
84
|
+
Push.push.emit("registration", {
|
|
85
|
+
registrationId: registrationId,
|
|
86
|
+
});
|
|
87
|
+
}.bind(this),
|
|
88
|
+
false
|
|
89
|
+
);
|
|
90
|
+
} else if (
|
|
91
|
+
((ref1 = device.manufacturer) != null ? ref1.toLowerCase() : void 0) ===
|
|
92
|
+
"xiaomi" &&
|
|
93
|
+
window.plugins.MiPushPlugin
|
|
94
|
+
) {
|
|
95
|
+
window.plugins.MiPushPlugin.init();
|
|
96
|
+
return document.addEventListener(
|
|
97
|
+
"mipush.receiveRegisterResult",
|
|
98
|
+
function (data) {
|
|
99
|
+
var registrationId;
|
|
100
|
+
console.log(data);
|
|
101
|
+
registrationId = "mi:" + data.regId;
|
|
102
|
+
Push.push.emit("registration", {
|
|
103
|
+
registrationId: registrationId,
|
|
104
|
+
});
|
|
105
|
+
},
|
|
106
|
+
false
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
}, 1000);
|
|
110
|
+
});
|
|
111
|
+
})
|
|
112
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steedos/service-ui",
|
|
3
|
-
"version": "2.5.13-beta.
|
|
3
|
+
"version": "2.5.13-beta.22",
|
|
4
4
|
"main": "package.service.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"steedos"
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
"description": "steedos package",
|
|
12
12
|
"repository": {},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@steedos/core": "2.5.13-beta.
|
|
15
|
-
"@steedos/i18n": "2.5.13-beta.
|
|
16
|
-
"@steedos/objectql": "2.5.13-beta.
|
|
14
|
+
"@steedos/core": "2.5.13-beta.22",
|
|
15
|
+
"@steedos/i18n": "2.5.13-beta.22",
|
|
16
|
+
"@steedos/objectql": "2.5.13-beta.22",
|
|
17
17
|
"express": "4.18.1"
|
|
18
18
|
},
|
|
19
19
|
"license": "MIT",
|
|
@@ -21,5 +21,5 @@
|
|
|
21
21
|
"publishConfig": {
|
|
22
22
|
"access": "public"
|
|
23
23
|
},
|
|
24
|
-
"gitHead": "
|
|
24
|
+
"gitHead": "a1f68ec601f8ed91dbd8eaecae9d5122f7018825"
|
|
25
25
|
}
|