Jump to content

Does anyone know how to do player re-engagement.


jjwallace
 Share

Recommended Posts

I am trying to send the players score to the challenged player after a round of my game Sea Frenzy on FB.

It seems the code they gave doesn't work.  I have implemented everything they have asked for.  See documentation link below.

 

// This will post a custom update. If the game is played in a messenger
// chat thread, this will post a message into the thread with the specified
// image and text message. And when people launch the game from this
// message, those game sessions will be able to access the specified blob
// of data through FBInstant.getEntryPointData().
FBInstant.updateAsync({
  action: 'CUSTOM',
  cta: 'Play',
  image: base64Picture,
  text: {
    default: 'Edgar just played BASH for 9 points!',
    localizations: {
      en_US: 'Edgar just played BASH for 9 points!',
      pt_BR: 'Edgar jogou BASH por 9 pontos!',
    }
  }
  template: 'WORD_PLAYED',
  data: { myReplayData: '...' },
  strategy: 'IMMEDIATE',
  notification: 'NO_PUSH',
}).then(function() {
  console.log('Message was sent successfully');
});

 

20274129_158585391373063_1501118020871782400_n.png?_nc_cat=0&oh=3f9ed71b18295c7f0ca631f9667585ee&oe=5C0179ED

Documentation Here: https://developers.facebook.com/docs/games/instant-games/rich-gameplay-features

Link to comment
Share on other sites

  • 3 weeks later...
  • 4 weeks later...

Hey JJ, long time no see ;)

Here is a bit of code we use, and seems to work ok:



var base64Picture = thumbnailImage; //this thumbnailImage is a large base64picture created online
//update the message to player
FBInstant.updateAsync({
	action: 'CUSTOM',
	cta: 'Play',
  	image: base64Picture,
  	text: {
    		default: facebookStuff.name + ' played their move',
    		localizations: {
      		  en_US: facebookStuff.name + ' played their move',
      		  es_LA: '\u00A1' + facebookStuff.name + ' jug\u00F3 su jugada!'
    		}
  	},
  	template: 'play_turn',
  	data: { myReplayData: '...' },
  	strategy: 'IMMEDIATE',
  	notification: 'NO_PUSH'
	}).then(function() {
  		// closes the game after the update is posted.
		consoleWrite("FBINSTANT Quit");
		FBInstant.quit();
	});

Don't know if you already got it sorted or not.. but may help.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...