ionic cordova xmpp Strophe si-filetransfer

84 views Asked by At

I am developing an ionic-cordova application with chat via Openfire. I can’t get the si-filetransfer plugin to work

This are the npm packages:

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

and this the code in file .ts:

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

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

but connection.si_filetransfer’ and ‘connection.ibb’ are always ‘undefined’

How can I import si_filetransfer and make it working?

Can anyone help me?

thanks in advance

1

There are 1 answers

0
incal On

It was a problem of include plugins from node modules, with this code works:

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');