title: Facebook Messenger API: Webviews Opening in Browser
body: <p>I'm trying to use the Facebook Messenger API to create a "generic" message with a button.  When that button is clicked, I want to display a "webview" (ie. a framed version of a webpage inside Messenger).</p>
  
  <p>However, even though my button has the required <code>webview_height_ratio</code> property, it still opens up in my phone's browser, not inside Messenger.  Since the Facebook documentation claims that that's all you need to make a button open a webview, I'm not sure what I might be doing wrong.</p>
  
  <p>The message I'm sending to Facebook to create the button (as part of a generic template) is:</p>
  
  <pre><code>{
      "recipient":{
          "id": "some ID"
      },
      "message": {
          "attachment":{
              "payload":{
                  "elements":[{
                      "buttons": [{
                          "title":"Webview example",
                          "type":"web_url",
                          "url":"http://www.example.com",
                          "webview_height_ratio":"compact"
                      }],
                      "image_url": "http://www.example.com/image.png",
                      "item_url": "http://www.example.com",
                      "subtitle":"It's a TV!",
                      "title":"Some TV"
                  }],
                  "template_type":"generic"
              },
              "type":"template"
          }
      }
  }
  </code></pre>
  
  <p>Can anyone tell me what I might be doing wrong?</p>
  
  <p><strong>EDIT:</strong> I'm not sure if it was necessary, but I have white-listed the domain I'm trying to point to for the webview (but obviously that hasn't helped).</p>