Skip to content
On this page

分享相关

介绍

shareUrl:直接分享内容到第三方平台。 showMoreSheet:导航栏顶部更多功能,目前支持分享、重新加载页面

目录

分享

接口名称

TrinaPlugin shareUrl

示例

js
window.cordova.exec(
  (data) => {
    console.log("成功", data);
  },
  (err) => {
    console.log("失败", err);
  },
  "TrinaPlugin",
  "shareUrl",
  [
    {
      shareLink: "https://download-app.trinablue.com/#/promote",
      shareTitle: "分享标题",
      shareInfo: "分享内容",
      shareIcon: "https://download-app.trinablue.com/static/images/logo.png",
    },
  ]
);

API

入参

参数必传类型默认值说明
shareLink是string无分享链接
shareTitle是string无分享标题
shareInfo是string无分享内容
shareIcon是string无分享图标

出参

  • 成功返回:string文本说明(分享平台名称)

  • 失败返回: JSON 数据

    参数必传类型说明
    shareMedia是string分享平台名称
    error是string错误信息

更多功能

接口名称

TrinaPlugin showMoreSheet

示例

js
window.cordova.exec(
  (data) => {
    console.log("成功", data);
  },
  (err) => {
    console.log("失败", err);
  },
  "TrinaPlugin",
  "showMoreSheet",
  [
    {
      shareLink: "https://download-app.trinablue.com/#/promote",
      shareTitle: "分享标题",
      shareInfo: "分享内容",
      shareIcon: "https://download-app.trinablue.com/static/images/logo.png",
    },
  ]
);

API

入参

数组,第一个元素为分享内容

参数必传类型默认值说明
shareLink是string无分享链接
shareTitle是string无分享标题
shareInfo是string无分享内容
shareIcon是string无分享图标

出参

  • 成功返回:Bool