2017-04-09 8 views

답변

0

스레드로 다시 보내려면 JSON 메시지를 작성한 다음 사용자 공유 단추를 클릭하거나 원하는 이벤트를 실행하고 MessengerExtensions.startShareFlow를 실행하고 성공 이벤트와 오류 이벤트, 작성한 메시지 및 메시지 공유 유형. 더 찾기 : the docs

<script> 
    var messageToShare = { 
     "attachment":{ 
     "type":"template", 
     "payload":{ 
      "template_type":"generic", 
      "elements": [{ 
       "title":"I took Peter's 'Which Hat Are You?' Quiz", 
       "image_url": "https://bot.peters-hats.com/img/hats/fez.jpg", 
       "subtitle": "My result: Fez", 
       "default_action":{ 
        "type":"web_url", 
        "url": "https://bot.peters-hats.com/view_quiz_results.php?user=24601" 
       }, 
       "buttons":[{ 
        "type":"web_url", 
        "url":"https://bot.peters-hats.com/hatquiz.php?referer=24601", 
        "title":"Take the Quiz" 
       }] 
      }] 
     } 
     } 
    }; 

    MessengerExtensions.beginShareFlow(function success(response) { 
    // Share successful 

    }, function error(errorCode, errorMessage) {  
    // The user was not able to share 

    }, 
    messageToShare, 
    "broadcast");  
</script>