IM分享功能


接口说明

支持版本>=10.0.2

We码可以调用IM分享功能,进行分享。

HWH5.share

请求参数

参数 类型 必填 说明
type String 类型
title String 标题
h5Uri String h5的Uri
from String 分享来源
desc String 描述
pcUri String PC的Uri。isPCDisplya值为1时,该参数为必传参数
isPCDisplay Number 是否在PC显示分享消息。1:显示,0:不显示
iconURL String 分享图标

返回结果

调起IM分享的页面。

请求示例

  • ES6版本

    const _shareParams = {
      title: 'title share',
      desc: 'desc share-01',
      h5Uri: 'h5://link.h5demo/html/index.html',
      pcUri: 'http://xxx.xxx.com/km/m/hi/bloglist/cn',
      isPCDisplay: 1,
      iconURL: 'https://xxx.xxx.com/xxx/xxx.jpg',
      from: 'link'
    };
    
    HWH5.share({
      type: 'IM',
      data: _shareParams
    }).catch(error => {
      console.log('分享发生异常', error);
    });
    
  • ES5版本

    var _shareParams = {
      title: 'title share',
      desc: 'desc share-01',
      h5Uri: 'h5://link.h5demo/html/index.html',
      pcUri: 'http://xxx.xxx.com/km/m/hi/bloglist/cn',
      isPCDisplay: 1,
      iconURL: 'https://xxx.xxx.com/xxx/xxx.jpg',
      from: 'link'
    };
    
    HWH5.share({
      type: 'IM',
      data: _shareParams
    }).catch(function (error) {
      console.log('分享发生异常', error);
    });
    

result. ""

    Not Found. ""