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"-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 } }}Indicates the orientation the game uses. Supported orientations: 'PORTRAIT' and 'LANDSCAPE'
Overrides the orientation the game uses on web. Supported orientations: 'PORTRAIT' and 'LANDSCAPE'
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.
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: '...',})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", } } } }}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.
原帖地址欢迎光临 Facebook开发者社区 (http://bbs.zcsftek.com/) | Powered by Discuz! X3.2 |