📅  最后修改于: 2022-03-11 15:00:25.810000             🧑  作者: Mango
pusher.me(function(error, user) {
// needed to call me() to gather user iden
pusher.enableEncryption('YOUR-END-TO-END-PASSWORD', user.iden);
var stream = pusher.stream();
stream.on('message', function(message) {
console.log(message); // message is decrypted automatically
});
stream.connect();
var options = {
source_user_iden: 'ujpah72o0',
target_device_iden: 'ujpah72o0sjAoRtnM0jc',
conversation_iden: '+1 303 555 1212',
message: 'Hello!'
};
pusher.sendSMS(options, function(error, response) {}); // options are encrypted automatically
});