简体   繁体   English

有没有其他方法可以在 FBInstant.updateAsync 中插入图像

[英]Is there any other way to insert image in FBInstant.updateAsync

I'm experiencing a trouble with this code我在使用此代码时遇到问题

FBInstant.updateAsync({ 
  action: 'CUSTOM', 
  template: 'play_turn', 
  cta: 'Join', 
  text: `Test user just played. Come join in game!`, 
  image: imagebase64encoded, 
}) 

When I run this code I get an error in console "GraphQL server responded with error 1675030: Error performing query."当我运行此代码时,我在控制台中收到错误消息“GraphQL 服务器响应错误 1675030:执行查询时出错。” When i Try to run this without image I get error in console "Custom update requires image or media input" My imagebase64encoded has no error.当我尝试在没有图像的情况下运行它时,我在控制台中收到错误“自定义更新需要图像或媒体输入”我的 imagebase64encoded 没有错误。 Did anyone experienced this problem?有没有人遇到过这个问题?

in front of your base64 string add在您的 base64 字符串前面添加

"data:image/png;base64,"

to make it base64 picture.使其成为base64图片。 so it will look like this所以它看起来像这样

"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8CwHwAExQHAgpnk/QAAAABJRU5ErkJggg=="

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在Facebook即时游戏中如何以及在哪里使用FBInstant.updateAsync - How and where to use FBInstant.updateAsync in facebook instant game 有没有办法在 JavaScript 中使用“prompt()”插入图像? - Is there any way to insert image using "prompt()" in JavaScript? 还有其他方法吗? - is there any other way of doing it? FBInstant未定义 - FBInstant is not defined FBInstant.shareAsync()函数在facebook即时游戏“共享”按钮中没有任何错误将不起作用 - FBInstant.shareAsync() function doesn't work without any errors in facebook instant game Share button 有没有其他方法来定义烤面包机 - Is there any other way to define Toaster 在href中插入图片的最佳方法 - best way to insert an image in href 有什么方法可以显示 pdf、docx、图像、excel 和其他在反应中选择的文件类型的预览? - Is there any way to show preview of pdf, docx, image, excel and other type of files selected in react? 如何使用PHP中的Foreach将数据从jquery文本框插入到MySql数据库中,或通过其他任何方法来实现此目标? - How do I INSERT data from jquery textBox into MySql database using Foreach in Php, or any other way to accomplish this goal? 任何方式拉伸背景图像 - Any way to stretch background image
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM