Skip to main content

I followed the example for how to create a Messenger Canvas App, and I got it to work. The problem is that it creates a button. After pressing that button, it displays some text. I cannot figure out how to reset the program to go back to the button so that I can begin making and testing my own changes to the program. The only way I’ve been able to do it is to change browsers, but there are only so many of those. I’ve tried deleting cookies and the cache, changing the APIs, resetting the project. I’m getting desperate here.  The example code is completely changing what is on the canvas:

app.post("/submit", (request, response) => {
  const body = request.body;
  response.send({
    canvas: {
      content: {
        components:
          { type: "text", text: "Someone just clicked something!", style: "header", align: "center" },
        ],
      },
    },
  });
});

I can’t try changing anything, because nothing happens at this point.

Hi @Rachel Shifflett -- Cam from the Intercom Support Engineering team here. 

I can see that you’ve got a conversation open with one of my teammates who’s put some questions to our Product Engineering team on this 👍 To avoid cross-communication and confusion I’ll let you focus on that discussion, hopefully we are able to get you some answers on this soon!


Hi @Rachel Shifflett !

It looks like my teammate Brian already reached out to you with an answer, but I’ll add it here in case anyone else is wondering:

“​If you add a button that hits your /submit endpoint to your end state canvas, you can use the component ID of that button to go back to the initial canvas - effectively resetting the state back to the initial one and allowing the user to go back through their app flow.”

Our docs here might be handy!


Reply