core
    正在准备搜索索引...

    接口 YmxShare

    分享

    interface YmxShare {
        systemShare(data: SystemShareData): Promise<void>;
    }

    层级 (查看层级一览)

    索引
    • 系统分享链接、图片、视频、文件、文字等内容。

      参数

      返回 Promise<void>

      //链接
      await ymx.systemShare({
      title: 'APP 打包',
      description: '信赖之选',
      thumb: 'https://i.cdn.yimenapp.com/sys/logo.png',
      content: {
      link: 'https://www.ymxapp.com'
      }
      });

      //文本
      await ymx.systemShare({
      title: '文本标题',
      content: {
      text: 'hello 世界'
      }
      });

      //图片链接
      await ymx.systemShare({
      title: '图片标题',
      content: {
      imageUrl: 'https://i.yimenyun.net/sys/1.jpg'
      }
      });

      const image = await ymx.downloadFile({
      url: 'https://i.yimenyun.net/sys/1.jpg'
      });
      //本地图片
      await ymx.systemShare({
      title: '图片标题',
      content: {
      imageFilePath: image.tempFilePath
      }
      });

      //视频链接
      await ymx.systemShare({
      title: '视频标题',
      content: {
      videoUrl: 'https://cdn.myapp.ltd/sys/sunflower.mp4'
      }
      });

      const video = await ymx.downloadFile({
      url: 'https://cdn.myapp.ltd/sys/sunflower.mp4'
      });
      //本地视频
      await ymx.systemShare({
      title: '视频标题',
      content: {
      videoFilePath: video.tempFilePath
      }
      });

      //文件链接
      await ymx.systemShare({
      title: '文件标题',
      content: {
      fileUrl: 'https://www.yimenapp.com/doc/doc.pdf'
      }
      });

      const file = await ymx.downloadFile({
      url: 'https://www.yimenapp.com/doc/doc.pdf'
      });
      //本地文件
      await ymx.systemShare({
      title: '文件标题',
      content: {
      filePath: file.tempFilePath
      }
      });