🎉Welcome Screen

The welcome screen displays when the user first chats with our fb page. We will set a greeting text and get started button.

welcome_screen_result

Set Get Started Button#

  1. Open the setWelcomeScreen.js file on a glitch, replace <postback_payload> with whatever words you want. Example here is the word MULAI.

    Show Details

    set postback get started button

Is it necessary to set get started button?

Yes, because it's the first user action in our app. we have to define our first response for app flow continutiy.

what's <postback_payload>?

<postback_payload> is like keyword from messenger to our app, that user just do something. such as click a Get Started Button.

Set Greeting Text#

  1. Open the setWelcomeScreen.js file on a glitch, change it according to the user's location, and the greeting text to convey.
    let request_body = {
    "greeting": [
    {
    "locale":"default", // greeting text will be based on the user's location outside the location we specify (default)
    "text":"Selamat Datang di HayWord !"
    }, {
    "locale":"en_US", // This text greeting will be displayed if the user is from US.
    "text":"Welcome to HayWord"
    }
    ]
    }

Saving Welcome Screen Setting#

after we set the 'Get Started' button and the 'Greeting' text, next is to save it in the following way :

  1. On the glitch page, click the 'tools' button> select 'Terminal'.

    Show Details

    open terminal

  2. In the terminal type 'node setWelcomeScreen.js'> press Enter on the keyboard. When successful, the response Get Started Button Sent! And Greeting Text Sent! Will appear.

    Show Details

    run setWelcomeScreen.js