【问题标题】:Send sms not working in push bullet with nodejs使用nodejs发送短信在推子弹中不起作用
【发布时间】:2016-03-03 14:42:45
【问题描述】:

我正在尝试在 nodeJs 中使用推送项目符号发送短信。从推送项目符号文档中,我得到了功能:“sendSMS”,可用于将消息作为 SMS 发送到手机。但是,当我运行代码时,它说“sendSMS 不是函数”。谁能帮我解决这个问题。

我的nodejs代码如下:

var pusher = new PushBullet('MY-API-KEY');

var options = {
source_user_iden: 'uj*******K',           
target_device_iden: 'uj***************q', 
conversation_iden: '+91 7********6',      
message: 'Hello!' };    

pusher.sendSMS(options, function(err, response) {
console.log(response); });

【问题讨论】:

    标签: node.js pushbullet


    【解决方案1】:

    你现在可能已经想通了,但是看起来 NPMjs.com 上的包可能有点过时了。如果您直接从 GitHub 存储库安装,则可以使用 sendSMS() 函数。

    以下是直接从 GitHub 安装的说明。 How to install an npm package from GitHub directly?

    【讨论】:

      【解决方案2】:

      我用这个包通过node js发送短信

      安装包:npm install springedge

      使用包的示例代码(发送短信推送请求):

      var springedge = require('springedge');
      
      var params = {
        'apikey': '', // API Key 
        'sender': 'SEDEMO', // Sender Name 
        'to': [
          '919019xxxxxxxx'  //Moblie Number 
        ],
        'message': 'test+message'
      };
      
      springedge.messages.send(params, 5000, function (err, response) {
        if (err) {
          return console.log(err);
        }
        console.log(response);
      });
      

      它对我有好处。

      【讨论】:

        猜你喜欢
        • 2013-09-22
        • 2016-02-12
        • 2018-05-20
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多