Push Notifications
Get push notifications when a transaction for a contract is created or confirmed
Sort uses Pusher to manage all push notifications, which makes it extremely easy to integrate with almost any application. The Pusher channel name and topic are listed on the contracts page of a Sort user's dashboard. Pusher documentation.
// app_key "ac91a1d4157ccb9e4203" is required for Sort
// the cluster may be changed
var pusher = new Pusher("ac91a1d4157ccb9e4203", {
cluster: 'us2'
});
// channel is specificed in the user dashboard
// topic is 'new' for new transactions, 'confirmed' for confirmed transactions
var channel = pusher.subscribe('CHANNEL_ID')
// Listen for new events
channel.bind('new', function (data) {
alert("New decoded transactions!" + JSON.stringify(data));
})
Last modified 6mo ago