搜索
热搜: 活动 交友 discuz
Hi~登录注册
查看: 22634|回复: 2
打印 上一主题 下一主题

FB小游戏解决纵向或横向显示更新

[复制链接]

44

主题

58

帖子

327

积分

实习版主

Rank: 7Rank: 7Rank: 7

积分
327
跳转到指定楼层
楼主
发表于 2019-4-22 10:51:55 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
Bundle Configuration Reference

fbapp-config.json is a configuration file you can put in the root directory of your bundle to specify settings for your application. These settings will apply to all users who the bundle is served to. This enables you to launch different bundles along with different application settings to different audiences. The content of this file should be a valid JSON object, with the member sections described below.

Type: {instant_games: {platform_version: "RICH_GAMEPLAY", orientation: ("PORTRAIT" | "LANDSCAPE"), override_web_orientation: ("PORTRAIT" | "LANDSCAPE"), navigation_menu_version: ("NAV_FLOATING" |"NAV_BAR"), custom_update_templates: {}, surfaceable_stats: {}, match_player_config: {min_context_size:number, max_context_size: number}}}

Properties

  • instant_games {platform_version: "RICH_GAMEPLAY", orientation: ("PORTRAIT" | "LANDSCAPE"), override_web_orientation: ("PORTRAIT" | "LANDSCAPE"), navigation_menu_version: ("NAV_FLOATING" |"NAV_BAR"), custom_update_templates: {}, surfaceable_stats: {}, match_player_config: {min_context_size: number, max_context_size: number}}
  • instant_games.platform_version "RICH_GAMEPLAY"
  • instant_games.orientation ("PORTRAIT" | "LANDSCAPE")
  • instant_games.override_web_orientation ("PORTRAIT" | "LANDSCAPE")
  • instant_games.navigation_menu_version ("NAV_FLOATING" | "NAV_BAR")
  • instant_games.custom_update_templates {}
  • instant_games.surfaceable_stats {}
  • instant_games.match_player_config {min_context_size: number, max_context_size: number}
  • instant_games.match_player_config.min_context_size number
  • instant_games.match_player_config.max_context_size number

instant_games

"Instant Games"-specific settings

Examples

{  "instant_games": {    "custom_update_templates": {      "first_place": {        "example": "Player X just became the first place in game Y!"      }    },    "surfaceable_stats": {      "rank": {        "priority": 1,        "order": 1,        "label": {          "localizations": {            "en_US": "Rank",            "th_TH": "\\u{0E22}\\u{0E28}"          },          "fallback": "Rank"        },        "values": {          "0": "Unranked",          "1": "Bronze",          "2": "Silver",          "3": "Gold"        }      }    },    "orientation": "PORTRAIT",    "override_web_orientation": "LANDSCAPE",    "navigation_menu_version": "NAV_FLOATING",    "match_player_config": {      "min_context_size": 2,      "max_context_size": 20    }  }}
orientation

Indicates the orientation the game uses. Supported orientations: 'PORTRAIT' and 'LANDSCAPE'


override_web_orientation

Overrides the orientation the game uses on web. Supported orientations: 'PORTRAIT' and 'LANDSCAPE'


navigation_menu_version

Indicates the platform navigation menu version the game should use. Supported navigation menu versions: 'NAV_FLOATING' and 'NAV_BAR' 'NAV_BAR' - Fixed top bar menu above the game container. 'NAV_FLOATING' - Small, expandable menu that the player may move around the game container.


custom_update_templates

Configures the templates for custom updates that the game can send out using the FBInstant.updateAsync API. The value of "custom_update_templates" should be an object, where the key is the ID of each template, and value is an object that configures the template. The value object should have the following properties: 'example' - a string example of what a custom update of this template will look like.

Examples

{  "instant_games": {    "custom_update_templates": {      "pass_score": {        "example": "Kun just scored 100 and passed Alissa's highscore!"      },      "play_turn": {        "example": "Kun just played HELLO. Now it's Alissa's turn!"      }    }  }}// game.jsFBInstant.updateAsync({  action: 'CUSTOM',  template: 'play_turn',  text: 'Kun just played HELLO. Now it\'s Alissa\'s turn!',  image: '...',  data: '...',})
surfaceable_stats

Configures stats for the player that can be displayed. The value of "surfaceable_stats" should be an object, where the key is the ID of each stat, and value is an object that configures the stat for display. The value object should have the following properties: 'priority' - an integer representing how important it is for the stat to displayed compared to the others, where 1 is the highest priority. Multiple stats can have the same priority. 'order' - specifies where it should be displayed in a list relative to the other stats, where a value of 1 means it should go first. The order values of the stats should be consecutive integers starting at 1 with no duplicates. 'label' - an object with two properties: 'localizations': an object where each key is a Facebook locale and each value is the string to display as the stat's name if the viewer is in that locale. 'fallback': the string to show if the viewer's locale is not found in the localizations object. 'values' - used to display stat values as strings like "Silver" or "Deckswabber" instead of integers. This property should be an object where each key is a string representation of a number (eg "1") and each value is what to display if the stat equals that number (such as "Gold").

Examples

{  "instant_games": {    "surfaceable_stats": {      "rank": {        "priority": 1,        "order": 1,        "label": {          "localizations": {            "en_US": "Rank",            "th_TH": "\u{0E22}\u{0E28}",          },          "fallback": "Rank"        },        "values": {          "0": "Unranked",          "1": "Bronze",          "2": "Silver",          "3": "Gold",        }      }    }  }}
match_player_config

Configures various settings for the matchPlayerAsync API. Currently the only configurable settings are minimum and maximum context sizes, which describes how big of a Messenger thread the players may be matched into when using the matchPlayerAsync API. The config must provide both 'min_context_size' and 'max_context_size', or the default values will be used for both.

'min_context_size' - The minimum number of players be matched together. The range should be between 2 and 50. Default is 2. 'max_context_size' - The maximum number of players be matched together. The range should be between 2 and 50. Default is 20.

原帖地址
https://developers.facebook.com/ ... s/sdk/bundle-config

回复

使用道具 举报

0

主题

9

帖子

39

积分

新手上路

Rank: 1

积分
39
沙发
发表于 2020-7-10 17:46:44 | 只看该作者
没签名
回复 支持 反对

使用道具 举报

0

主题

15

帖子

51

积分

注册会员

Rank: 2

积分
51
板凳
发表于 2020-9-23 15:30:06 | 只看该作者
回复 支持 反对

使用道具 举报

游客
回复
您需要登录后才可以回帖 登录 | 立即注册

快速回复 返回顶部 返回列表