简体   繁体   中英

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." 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. Did anyone experienced this problem?

in front of your base64 string add

"data:image/png;base64,"

to make it base64 picture. so it will look like this

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM