【问题标题】:ionic cordova xmpp Strophe si-filetransferionic cordova xmpp Strophe si-filetransfer
【发布时间】:2020-07-04 05:26:20
【问题描述】:

我正在通过 Openfire 开发一个带有聊天功能的 ionic-cordova 应用程序。 我无法让 si-filetransfer 插件工作

这是 npm 包:

"strophe.js": "^1.2.14",
"strophejs-plugin-http-file-upload": "^1.0.3",
"strophejs-plugins": "0.0.7",

这是文件 .ts 中的代码:

  import { Strophe } from 'strophe.js';
  ........

  this.connection.si_filetransfer.addFileHandler(self.fileHandler);
  this.connection.ibb.addIBBHandler(self.ibbHandler);

但是connection.si_filetransfer'和'connection.ibb'总是'undefined'

如何导入 si_filetransfer 并使其工作?

谁能帮帮我?

提前致谢

【问题讨论】:

    标签: xmpp cordova-plugins ionic4 strophe.js


    【解决方案1】:

    这是来自节点模块的包含插件的问题,这段代码有效:

    import { Strophe } from 'strophe.js';
    require('strophejs-plugin-http-file-upload');
    require('strophejs-plugins/si-filetransfer/strophe.si-filetransfer.js');
    require('strophejs-plugins/ibb/strophe.ibb.js');
    

    【讨论】:

      猜你喜欢
      • 2015-12-08
      • 1970-01-01
      • 1970-01-01
      • 2017-06-28
      • 2014-07-30
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-01-04
      相关资源
      最近更新 更多