- JS API 列表
- 基础
- 网络
- 媒体
- 地图
- 文件
- 开放接口
- 数据缓存
- 地理位置
- 设备
- 画布
- 界面
- 页面导航
- 侧边栏能力
- 行业开放
- AI/AR能力
- 第三方平台
- TTML
- 转发和挂载
- 其它
- 直播能力
tt.openAwemeUserProfile
更新时间 2024-07-24 02:58:49
收藏
我的收藏基础库 1.84.0 开始支持本方法,这是一个异步方法。
警告
跳转个人抖音号主页,用户可以选择关注/取消关注抖音号。暂时只支持在抖音和抖音 Lite App 上使用。
语法
text复制tt.openAwemeUserProfile(options)
参数说明
options 为 object 类型,属性如下:
属性名 | 类型 | 默认值 | 必填 | 说明 | 最低支持版本 |
success | function | | 否 | 接口调用成功后的回调函数 | 1.84.0 |
fail | function | | 否 | 接口调用失败后的回调函数 | 1.84.0 |
complete | function | | 否 | 接口调用结束后的回调函数(调用成功、失败都会执行) | 1.84.0 |
回调成功
object 类型,属性如下:
属性名 | 类型 | 说明 | 最低支持版本 |
errMsg | string | "openAwemeUserProfile:ok" | 1.84.0 |
回调失败
object 类型,属性如 下:
属性名 | 类型 | 说明 | 最低支持版本 |
errMsg | string | "openAwemeUserProfile:fail " + 详细错误信息 | 1.84.0 |
errNo | number | 错误码 | 2.53.0 |
错误说明
errNo | errMsg | 说明 | 最低支持版本 |
21100 | openAwemeUserProfile:fail openAwemeUserProfile:%s | 打开个人抖音号主页失败 | 2.53.0 |
10301 | openAwemeUserProfile:fail feature is not supported in app | 宿主未实现 | 2.53.0 |
10601 | openAwemeUserProfile:fail not login | 没有登录 | 2.53.0 |
21101 | openAwemeUserProfile:fail aweme uid is null | 没有绑定想要跳转的抖音号 | 2.53.0 |
扫码体验
代码示例
js复制tt.openAwemeUserProfile({
success: (res) => {
console.log(res);
},
});
使用效果
调用后跳转到抖音主页
Bug & Tip
- •Tip: 使用该功能前开发者需要绑定想要跳转的抖音号;
- •Tip: 没有绑定想要跳转的抖音号,会触发 fail 回调,对应的错误码是 21101。
- •Tip: 该功能不支持抖音号入参,只能跳转唯一的普通抖音号,跳转指定的抖音号见button(open-type=openAwemeUserProfile)。
点击纠错