Instant Games chooseAsync and sending invitation

0 favourites
  • 10 posts
From the Asset Store
Easily generate many levels from a set of pre-built scenes (Construct 3 template)
  • Hollo in my FB Instant Game I can send invitation, with custom photo, to other user via messanger or share Instant Game video on player's time line.

    But the messanger invitation is send with generic message. I have set custom CTA, text and template in fbapp-config.json but it doesn't work.

    I also would like to display custom image and taxt while sharing invitation on player's time line. Do you have any idea what could be the problem?

     "FBInstant.context.chooseAsync()
    .then(function () {
     FBInstant.updateAsync({
     action: 'CUSTOM',
     cta: 'Zagraj!',
     image: '" & image64 & "',
     text: 'test wiadomosc',
     template: 'GAME_TEMPLATE', strategy: 'IMMEDIATE', notification: 'NO_PUSH'}) });"
    

    fbapp-config.json

    {
    	"instant_games": {
    
    	
    		"custom_update_templates": {
    			"GAME_TEMPLATE": {
    				"example": "Test tekst do wyswietlenia!",
    							}
    		},
    		
    		"orientation": "PORTRAIT",
    		"navigation_menu_version": "NAV_FLOATING",
    		"match_player_config": {
    			"min_context_size": 2,
    			"max_context_size": 20
    		}
    		
    		
    	}
    }
  • Have you specified an image? Make sure you have a correct base64Picture set.

    For me it works fine with

    template: 'play_turn',

  • fredriksthlm as I mentioned - no problem with picture. Invitation send image but not custom message. Could you post your code. It would help me a lot.

  • I can also just see standard cta (Play Now)

    But text is what I specify. Same code as you have.

    Only difference I see is that I use:

    template: 'play_turn',

    And I have not specified anyting in the app config file. just quickly try to delete all that, and set 'play_turn', to see if you get the correct text.

  • 5 minutes ago Facebook uploaded examples to their repository at their github regarding exact this.

    This is their payload:

    {

    action: 'CUSTOM',

    cta: 'Say Congrats!',

    text: {

    default: ' english text',

    localizations: {

    en_US: 'UStext',

    es_LA: 'spanish',

    pt_BR: 'portuguese'

    }

    },

    template: 'play_turn',

    data: { myCustomData: '42' },

    strategy: 'IMMEDIATE',

    notification: 'NO_PUSH'

    };

    Which is the same I always use.

  • Thanks and how does your app config custom_update_template looks?

    		"custom_update_templates": {
    		
     "play_turn": {
     "example": "Kun just played HELLO. Now it's Alissa's turn!"
     }
    		},
    
  • i don't have any of that in my app config file.

    the only line I have is the now mandatory navigation line:

    {

    "instant_games": {

    "navigation_menu_version": "NAV_FLOATING",

    }

    }

  • this is what i have now

    Config file:

    {
    
    "instant_games": {
    
    "navigation_menu_version": "NAV_FLOATING",
    
    }
    
    }

    app

     "FBInstant.context.chooseAsync()
    .then(function () {
     FBInstant.updateAsync({
     action: 'CUSTOM',
     cta: 'Say Congrats!',
     image: '" & image64 & "',
     text: {
    default: ' english text',
    localizations: {
    en_EN: 'UStext',
    es_LA: 'spanish',
    pt_BR: 'portuguese'
    }},
     template: 'play_turn',
    data: { myCustomData: '42' },
    strategy: 'IMMEDIATE',
    notification: 'NO_PUSH'}) });"

    and i still can send only generic message (something like "user X just played, Now's your turn")

  • Oh! I am sorry for this, I actually now tried one of my games and switched contect (choose and update async) and I now see the same as you do. Text is not mine, just a standard (localized) FB text.

    Must have been in some late update of facebook! my code has been the same for months, now it works out like yours!

    I know they changed the message for updateAsync Leaderboard, in october. Maybe they changed the updateAsync Custom as well...

    Maybe you can ask in the Instant Games forum, or file a bug report

    But as I said: in their offical github (which they uploaded one hour ago) they use this code. So maybe this bug is just temprary for today. (It happens a lot that some stuff break for a day or two and then came back)

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • He this calms me a bit. A though something is wrong with my app. I'll keep on looking for answer. Thanks for your time.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)