Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as XML by Caroline ( 7 years ago )
<?php
$user_ref = 'payload-' . strval(time());
$app_id = 12345;
$page_id = 6789; // with domain whitelisted
?>
<html>
<body>
<script>
window.fbAsyncInit = function() {
FB.init({
appId : '<?=$app_id?>',
autoLogAppEvents : true,
xfbml : true,
version : 'v4.0'
});
FB.Event.subscribe('send_to_messenger', function(e) {
console.log('Got event: ' + e.event + ' with ref:' + e.ref);
if(e.event == 'opt_in'){
alert('Got opt-in for ' + e.ref);
}
});
};
</script>
<script async defer src="https://connect.facebook.net/en_US/sdk.js"></script>
<h3>Send to Messenger Plugin Test</h3>
<div style="height:100px">
<div class="fb-send-to-messenger"
messenger_app_id="<?=$app_id?>"
page_id="<?=$page_id?>"
data-ref="<?=$user_ref?>"
color="blue"
size="standard">
</div>
</div>
<p><span>user_ref: </span><?=$user_ref?></p>
<script>
FB.Event.subscribe('send_to_messenger', function(e) {
// callback for events triggered by the plugin
console.dir(e);
});
</script>
</body>
</html>
Revise this Paste
Parent: 100868