字节小程序文档
小游戏
小程序
小游戏
接入指南
普通小游戏开发
即玩Unity&UE小游戏开发
数据
运营
规范
社区
普通小游戏开发
框架
小游戏配置
模块化
require
module
exports
场景值
分包加载
简介
分包加载
基础功能
tt
console
tt.env
网络请求
开放能力(必读)
登录
tt.login
tt.checkSession
社交转发裂变
分享介绍总览
用户信息及授权
用户信息
tt.getUserInfo
authenticateRealName
实名认证完成
敏感数据处理
设置
tt.getSetting
tt.openSetting
AuthSetting
授权
tt.authorize
用户授权
tt.showDouyinOpenAuth
广告
tt.createBannerAd
tt.createRewardedVideoAd
tt.createInterstitialAd
BannerAd
BannerAd
BannerAd.hide
BannerAd.show
BannerAd.onLoad
BannerAd.offLoad
BannerAd.onError
BannerAd.offError
BannerAd.onResize
BannerAd.offResize
BannerAd.destroy
RewardedVideoAd
RewardedVideoAd
RewardedVideoAd.show
RewardedVideoAd.onLoad
RewardedVideoAd.offLoad
RewardedVideoAd.load
RewardedVideoAd.onError
RewardedVideoAd.offError
RewardedVideoAd.onClose
RewardedVideoAd.offClose
RewardedVideoAd.destroy
激励视频广告注意
InterstitialAd
InterstitialAd
InterstitialAd.show
InterstitialAd.load
InterstitialAd.destroy
InterstitialAd.onLoad
InterstitialAd.offLoad
InterstitialAd.onError
InterstitialAd.offError
InterstitialAd.onClose
InterstitialAd.offClose
插屏广告注意事项
收藏
tt.showFavoriteGuide
tt.onFavoriteStateChange
关注
功能说明
游戏内关注抖音号
tt.openAwemeUserProfile
关注头条号
tt.createFollowButton
FollowButton
tt.checkFollowState
内容安全
内容安全检测
图片检测
数据分析
tt.reportAnalytics
视频拍摄器
调起方法
订阅消息
订阅消息能力介绍
tt.requestSubscribeMessage
开放数据域
tt.getOpenDataContext
tt.onMessage
开放数据
tt.getCloudStorageByRelation
tt.setUserCloudStorage
tt.getUserCloudStorage
tt.removeUserCloudStorage
tt.getSharedCanvas
KVData
排行榜
挑战排行榜
tt.setUserGroup
客服能力
tt.openCustomerServiceConversation
tt.createContactButton
ContactButton
API
小游戏
字节跳动小游戏
基础
tt.canIUse
添加到桌面
tt.addShortcut
tt.checkShortcut
渲染
字体
tt.loadFont
帧率
tt.setPreferredFramesPerSecond
requestAnimationFrame
cancelAnimationFrame
图片
tt.createCanvas
tt.createImage
Canvas.getContext
Canvas.toTempFilePath
资源压缩
tt.createBuffer
tt.infalte
设备
加速度计
tt.startAccelerometer
tt.stopAccelerometer
tt.onAccelerometerChange
剪贴板
tt.getClipboardData
tt.setClipboardData
罗盘
tt.startCompass
tt.stopCompass
tt.onCompassChange
网络
tt.getNetworkType
tt.onNetworkStatusChange
屏幕亮度
tt.setKeepScreenOn
振动
tt.vibrateLong
tt.vibrateShort
扫码
tt.scanCode
陀螺仪
tt.startGyroscope
tt.stopGyroscope
tt.onGyroscopeChange
tt.offGyroscopeChange
日历
tt.addPhoneCalendar
文件
tt.getFileSystemManager
FileSystemManager
FileSystemManager
FileSystemManager.access
FileSystemManager.accessSync
FileSystemManager.saveFile
FileSystemManager.saveFileSync
FileSystemManager.getSavedFileList
FileSystemManager.removeSavedFile
FileSystemManager.copyFile
FileSystemManager.copyFileSync
FileSystemManager.getFileInfo
FileSystemManager.mkdir
FileSystemManager.mkdirSync
FileSystemManager.readdir
FileSystemManager.readdirSync
FileSystemManager.readFile
FileSystemManager.readFileSync
FileSystemManager.rename
FileSystemManager.renameSync
FileSystemManager.rmdir
FileSystemManager.rmdirSync
FileSystemManager.stat
FileSystemManager.statSync
FileSystemManager.unlink
FileSystemManager.unlinkSync
FileSystemManager.unzip
FileSystemManager.writeFile
FileSystemManager.writeFileSync
Stats
Stats
Stats.isDirectory
Stats.isFile
位置
tt.getLocation
媒体
音频
tt.addAudioTrack
tt.createInnerAudioContext
tt.getAudioContext
InnerAudioContext
AudioContext
图片
ImageFile
tt.chooseImage
tt.previewImage
tt.saveImageToPhotosAlbum
tt.getImageInfo
麦克风
tt.requestMicrophone
tt.pauseMicrophone
tt.resumeMicrophone
录屏
tt.getGameRecorderManager
GameRecorderManager
tt.mergeVideo
相机
tt.createCamera
Camera
Camera.start
Camera.pause
Camera.resume
Camera.setBeautifyParam
Camera.destroy
录音
RecorderManager
tt.getRecorderManager
视频
tt.chooseVideo
tt.createVideo
tt.createOffscreenVideo
tt.saveVideoToPhotosAlbum
Video
人脸检测
tt.createFaceDetector
Detector
DetectData
手势识别
tt.createHandDetector
Detector
HandInfo
手势说明
网络
下载
DownloadTask
tt.downloadFile
发起请求
RequestTask.abort
RequestTask
tt.request
上传
tt.uploadFile
UploadTask
Websocket
SoketTask
tt.connectSocket
游戏转发分享
分享逻辑
ShareParam
tt.showShareMenu
视频拍摄器
剪映模版
tt.hideShareMenu
tt.onShareAppMessage
tt.offShareAppMessage
tt.shareAppMessage
tt.navigateToVideoView
数据缓存
tt.clearStorage
tt.clearStorageSync
tt.getStorage
tt.getStorageSync
tt.getStorageInfo
tt.getStorageInfoSync
tt.removeStorage
tt.removeStorageSync
tt.setStorage
tt.setStorageSync
系统
生命周期
tt.exitMiniProgram
tt.getLaunchOptionsSync
tt.onShow
tt.onHide
tt.offShow
tt.offHide
系统信息
tt.getSystemInfoSync
tt.getSystemInfo
触摸事件
Touch
tt.onTouchStart
tt.onTouchMove
tt.onTouchEnd
tt.onTouchCancel
tt.offTouchStart
tt.offTouchMove
tt.offTouchEnd
tt.offTouchCancel
应用级事件
tt.onError
tt.offError
定时器
setTimeout
setInterval
clearTimeout
clearInterval
界面
交互
按钮
tt.showModal
tt.showLoading
tt.showActionSheet
tt.hideLoading
tt.showToast
tt.hideToast
键盘
tt.showKeyboard
tt.updateKeyboard
tt.hideKeyboard
tt.onKeyboardComplete
tt.onKeyboardConfirm
tt.onKeyboardInput
tt.offKeyboardComplete
tt.offKeyboardConfirm
tt.offKeyboardInput
菜单
tt.getMenuButtonLayout
支付
小游戏支付简介
接入流程
tt.requestGamePayment
获取游戏币余额
游戏币扣除接口
游戏币赠送接口
支付签名生成算法
服务端回调接口
Worker
tt.createWorker
Worker
Worker.onMessage
Worker.postMessage
Worker.terminate
分包加载
tt.loadSubpackage
LoadSubpackageTask
更新
tt.getUpdateManager
UpdateManager
UpdateManager
UpdateManager.onCheckForUpdate
UpdateManager.onUpdateReady
UpdateManager.onUpdateFailed
UpdateManager.applyUpdate
其它
本地数据缓存
性能
tt.getPerformance
tt.onMemoryWarning
tt.triggerGC
服务端
服务端API介绍
接口调用凭证
getAccessToken
登录
code2Session
数据缓存
setUserStorage
removeUserStorage
二维码
createQRCode
其它
用户登录态签名
订阅消息
发送订阅消息
多端支持
使用限制
开发者工具
开发辅助
开发者工具介绍
小游戏开发工具
IDE 命令行工具
代码片段
真机调试
开发者工具更新及下载
最近更新
更新日志
版本分布及各 APP 对应关系
兼容性说明
自2022年9月6日起,本文档站不再更新内容,相关文档已迁移至全新“抖音开放平台”
前往
小游戏支付简介
产品介绍
字节跳动小游戏支付组件是面向有开发能力的小游戏开发者提供的基础能力,支持多种主流支付方式,方便开发者快速接入,提升用户的支付体验和订单转化率。
查看原图
优势
一次接入,同时获取多种主流支付方式,研发接入成本低。
与字节系的用户账号打通,用户端的体验统一。
提供小游戏钱包能力,降低开发者研发成本。
资金流
收款的资金流将经由字节跳动账户,月度结算处理。
点击纠错
该文档是否对你的开发有所帮助?
有帮助
没帮助
该文档是否对你的开发有所帮助?
有帮助
没帮助
小游戏支付简介
产品介绍
优势
资金流