Answered

Reset Canvas App to starting point

  • 7 February 2024
  • 2 replies
  • 24 views

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.

icon

Best answer by Jacob Cox 17 February 2024, 21:46

View original

2 replies

Userlevel 2
Badge +3

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!

Userlevel 4
Badge +5

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