MCPcopy Index your code
hub / github.com/dcloudio/mui / share

Function share

plugin/share/plusShare.js:24–50  ·  view source on GitHub ↗
(id, msg, callback)

Source from the content-addressed store, hash-verified

22 };
23
24 function share(id, msg, callback) {
25 var service = shareServices[id];
26 if (!service) {
27 plus.nativeUI.alert('无效的分享服务[' + id + ']');
28 callback && callback(false);
29 return;
30 }
31 var _share = function() {
32 service.send(msg, function() {
33 plus.nativeUI.toast("分享到\"" + service.description + "\"成功!");
34 callback && callback(true);
35 }, function(e) {
36 plus.nativeUI.toast("分享到\"" + service.description + "\"失败!");
37 callback && callback(false);
38 })
39 };
40 if (service.authenticated) {
41 _share(service, msg, callback);
42 } else {
43 service.authorize(function() {
44 _share(service, msg, callback);
45 }, function(e) {
46 plus.nativeUI.alert("认证授权失败");
47 callback && callback(false);
48 })
49 }
50 };
51
52 function openSystem(msg, callback) {
53 if (plus.share.sendWithSystem) {

Callers 1

openFunction · 0.85

Calls 2

callbackFunction · 0.85
_shareFunction · 0.85

Tested by

no test coverage detected