渠道参考
渠道就是你发行的所在平台 —— Facebook Instant、Google Play、iOS、开放 web、Samsung Instant Play 等等。每个渠道在广告、计费、登录等方面都有自己的后端,FRVR SDK 把这些差异藏在统一的 API 后面。
FRVR 当前支持的渠道
Section titled “FRVR 当前支持的渠道”| 渠道 | 发行目标 | 备注 |
|---|---|---|
web | 开放 web、嵌入合作伙伴(门户站) | 多数游戏发 web/手机 web 用这个。 |
facebook-instant | Facebook Instant Games | 启用 Shield 浮层、Facebook 好友、原生内购。 |
facebook-rooms | Facebook Rooms(视频通话) | 在 Instant 之上扩展了 room-context 特性。 |
google-play | Google Play(TWA / 混合壳) | Play Billing、Play Games、Play 成就。 |
ios | iOS 原生 app(WebKit 桥) | Apple IAP、Game Center、StoreKit。 |
samsung-galaxy | Samsung Galaxy Store | Samsung Account、Galaxy IAP。 |
samsung-instant-play | Samsung Instant Play(云) | 关心会话时长,无设备本地存储。 |
xiaomi | Xiaomi QuickGame | Xiaomi 账号、Mi Pay。 |
dev | 仅本地开发 | 把所有 provider 做成假实现,让 demo 和测试无需真实环境也能跑。FRVR 绝不会把这个发到生产。 |
不是每个模块在每个渠道都能用。在显示功能 UI 之前,请用每行展示的运行时检查 —— FRVR 给某个平台注入的渠道包对不支持的功能直接返回 “否”,所以用这些检查包住 UI 能让代码具备跨平台可移植性。
| 模块 | 支持检查 | Web | FB Instant | iOS | Google Play | Samsung |
|---|---|---|---|---|---|---|
| 广告 | FRVR.ads.isSupported(AdType.INTERSTITIAL) · FRVR.ads.isReady(type) | ✓ | ✓ | ✓ | ✓ | ✓ |
| 内购 | FRVR.iap.isReady() —— 也可以用 FRVR.iap.onReady(cb) | — | ✓ | ✓ | ✓ | ✓ |
| 登录(FRVR) | FRVR.auth.isPlatformAvailable('FRVR') · FRVR.auth.isLoggedIn() | ✓ | ✓ | ✓ | ✓ | ✓ |
| 社交(好友) | FRVR.social.platform.getSupportedAPIs().length > 0 | ✓ | ✓ | ✓ | ✓ | — |
| 排行榜 | FRVR.leaderboards.isSupported() | ✓ | ✓ | ✓ | ✓ | ✓ |
| 锦标赛 | FRVR.tournaments.platform.isSupported() | ✓ | ✓ | — | — | — |
| 挑战 | (await FRVR.challenges.getPossibleOpponents()).length > 0 | ✓ | ✓ | — | — | — |
| 通知 | await FRVR.notifications.canScheduleMessages() | — | ✓ | ✓ | ✓ | — |
| 快捷方式 | await FRVR.shortcut.canCreateShortcut() | ✓ | — | — | — | — |
| 跨平台 | await FRVR.crossplay.canMoveToMobile() | ✓ | ✓ | — | — | — |
| 导航 | FRVR.navigation.canNavigate() · FRVR.navigation.canOpenChannelAppStore() | ✓ | ✓ | ✓ | ✓ | ✓ |
| 分数(原生) | typeof FRVR.score !== 'undefined' | — | — | ✓ | ✓ | — |
| Shield 浮层 | (await FRVR.shield.createOverlay(…)) !== null | — | ✓ | — | — | — |
| 社区 CTA | await FRVR.community.canFollowOfficialPage() · await FRVR.community.canJoinOfficialGroup() | — | ✓ | — | — | — |
上面打勾仅作起点参考 —— 渠道能力会随平台更新而变。运行时的 isSupported / can… 检查永远是权威。
部分渠道接受 FRVR.config.channels 下的渠道专属字段:
只有当前激活渠道下的字段会被读取。同一份 FRVR.config 可以发到所有版本 —— FRVR 构建流水线会决定每次读哪个分支。