3

I'm doing the sharing in my instant game. I'm firing next req from the game:

FBInstant.shareAsync(
{
    intent: 'REQUEST',
    image: 'image-encoded-here',
    text: 'Edgar just played BASH for 9 points!',
    data: { myReplayData: 'message sent' },
}
).then( function()
{
    console.log("sharing is done");
})
.catch( function(err)
{
   console.log('failed to share: ' + err.code + " :: " + err.message);
});

but I'm receiving 500-error:

https://www.facebook.com/games/quicksilver/share_score/?dpr=2 500 () failed to share: NETWORK_FAILURE ::

=====================================

in My particulare case problems was with encoded image. As i remember, image to share should include all the encoded image stuff with "data:image/jpeg;base64,/" in front.

2 Answers2

-1

Look at your "image" parameter in the shareAsync(). You must send a Base64 url or it will go wrong.

  • Despite you actually giving the correct solution, it appears you're getting downvoted because your answer was too vague and uninformative. I'm sorry to see that. – Eliezer Berlin Apr 10 '19 at 08:10
-1

Try removing the "," from the line

data: { myReplayData: 'message sent' },
data: { myReplayData: 'message sent' }
Mark Amery
  • 143,130
  • 81
  • 406
  • 459
  • -1; trailing commas in object literals are legal in modern JavaScript, so there's no need to remove this one, and there's no plausible way that one could cause a 500 error from a remote server anyway. – Mark Amery Nov 04 '18 at 16:52