0

下面是我正在使用的代码

社交分享.js

function SocialSharing() {
}

SocialSharing.prototype.available = function (callback) {
  cordova.exec(function (avail) {
    callback(avail ? true : false);
  }, null, "SocialSharing", "available", []);
};

SocialSharing.prototype.share = function (message, subject, image, url, successCallback, errorCallback) {
  cordova.exec(successCallback, errorCallback, "SocialSharing", "share", [message, subject, image, url]);
};

SocialSharing.install = function () {
  if (!window.plugins) {
    window.plugins = {};
  }

  window.plugins.socialsharing = new SocialSharing();
  return window.plugins.socialsharing;
};

cordova.addConstructor(SocialSharing.install);

详细视图.js

从我的网页调用共享插件

window.socialShare.share("test");

配置文件

<?xml version="1.0" encoding="UTF-8"?>

<widget xmlns     = "sd"
        id        = "io.cordova.helloCordova"
        version   = "2.7.0">
    <name>HTML Displayer</name>

    <description>
       HTML Displayer
    </description>

    <author href="" email="">
        Modulaity Team
    </author>

    <access origin="*"/>


    <content src="index.html" />

    <preference name="loglevel" value="DEBUG" />
    <!--
      <preference name="splashscreen" value="resourceName" />
      <preference name="backgroundColor" value="0xFFF" />
      <preference name="loadUrlTimeoutValue" value="20000" />
      <preference name="InAppBrowserStorageEnabled" value="true" />
      <preference name="disallowOverscroll" value="true" />
    -->
    <!-- This is required for native Android hooks -->
    <feature name="App">
        <param name="android-package" value="org.apache.cordova.App" />
    </feature>
    <feature name="SocialSharing">
        <param name="android-package" value="com.bnppf.ssc.imb.sf.shell.htmldisplayer.plugins.SocialShare" />
    </feature>
    <feature name="NetworkStatus">
        <param name="android-package" value="org.apache.cordova.NetworkManager" />
    </feature>
</widget>

在 android 4.4 中,社交共享运行良好,但在 Android 2.3 到 android 4.0 中。我得到了上面的弹出窗口......

我究竟做错了什么?

4

0 回答 0