我正在尝试在聊天环境中调用FBInstant.updateAsync()(id = THREAD).它已成功解析,但不会在聊天时发布任何消息.有人知道为什么会这样吗?
问题已修复,工作代码:
FBInstant.updateAsync({
action: 'CUSTOM',
//cta: 'Join The Fight',
image: 'data:image/jpeg;base64,/...',
text: 'X just invaded Y\'s village!',
template: 'test_template',
data: { myReplayData: '...' },
strategy: 'IMMEDIATE',
notification: 'NO_PUSH',
}).then(
() =>{
console.log('updateAsync() success!' + JSON.stringify(data));
FBInstant.quit();
},
error => {
console.error('updateAsync() ERROR! ' + JSON.stringify(error));
}
);
Run Code Online (Sandbox Code Playgroud)
这是我的fbapp-config.json:
{
"instant_games": {
"platform_version": "RICH_GAMEPLAY",
"custom_update_templates": {
"test_template": {
"example": "X just invaded Y's village!"
}
}
}
}
Run Code Online (Sandbox Code Playgroud)