Strophe si-filetransfer in ionic-cordova

17 просмотров
Перейти к первому непрочитанному сообщению

Maurizio Poli

не прочитано,
30 мар. 2020 г., 13:07:1030.03.2020
– Strophe
hi,

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

Filipe Fernandes

не прочитано,
30 мар. 2020 г., 13:46:4030.03.2020
– str...@googlegroups.com
Hey, Im not sure, but probably you need to require the package so it injects its code to strophe, (not import) ex: top line of file put: require('strophejs-plugin-http-file-upload')

--
You received this message because you are subscribed to the Google Groups "Strophe" group.
To unsubscribe from this group and stop receiving emails from it, send an email to strophe+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/strophe/23d84214-4554-432f-bb8b-658a2f73a166%40googlegroups.com.

Maurizio Poli

не прочитано,
31 мар. 2020 г., 04:43:3831.03.2020
– Strophe
Hi,
thank's for you help

could you help me try the 'require' at the 'si_filetransfer', I tried:

require('strophe.si-filetransfer')


require('strophejs-plugins-si-filetransfer')


require('si-filetransfer')


I always get:

Cannot find module "..."




Il giorno lunedì 30 marzo 2020 19:46:40 UTC+2, Filipe Fernandes ha scritto:
Hey, Im not sure, but probably you need to require the package so it injects its code to strophe, (not import) ex: top line of file put: require('strophejs-plugin-http-file-upload')
On 25 Mar 2020, at 09:19, 'Maurizio Poli' via Strophe <str...@googlegroups.com> wrote:

hi,

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


--
You received this message because you are subscribed to the Google Groups "Strophe" group.
To unsubscribe from this group and stop receiving emails from it, send an email to str...@googlegroups.com.

Filipe Fernandes

не прочитано,
31 мар. 2020 г., 04:45:0231.03.2020
– str...@googlegroups.com
Should be the same name you have on package json

To unsubscribe from this group and stop receiving emails from it, send an email to strophe+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/strophe/b8837b25-7dd5-4939-8963-dae25f7596ad%40googlegroups.com.

Maurizio Poli

не прочитано,
31 мар. 2020 г., 04:59:1231.03.2020
– Strophe
this in my package json:

    "strophejs-plugins": "0.0.7",

this in my file .ts

require('strophejs-plugins');


but I still get:

Cannot find module"strophejs-plugin"


Filipe Fernandes

не прочитано,
31 мар. 2020 г., 05:05:4431.03.2020
– str...@googlegroups.com
try only
require('strophejs-plugin-http-file-upload');

To unsubscribe from this group and stop receiving emails from it, send an email to strophe+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/strophe/8df5a058-e5b4-492e-9581-12bdee15684c%40googlegroups.com.

Maurizio Poli

не прочитано,
31 мар. 2020 г., 05:12:4731.03.2020
– Strophe
strophejs-plugin-http-file-upload is included without errors but it is for another type of file transfer


https://github.com/strophe/strophejs-plugin-si-filetransfer/blob/master/readme.md
try only
require('strophejs-plugin-http-file-upload');

Filipe Fernandes

не прочитано,
31 мар. 2020 г., 05:14:5531.03.2020
– str...@googlegroups.com
Ah, then easy way is to download that 
strophe.si-filetransfer.js
 and require that file directly

To unsubscribe from this group and stop receiving emails from it, send an email to strophe+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/strophe/c34f654f-62e8-405c-859b-99ecf3892117%40googlegroups.com.

Maurizio Poli

не прочитано,
31 мар. 2020 г., 05:34:3231.03.2020
– Strophe
if I understand correctly you suggest me not to use the npm but to directly include the .js files

I already had this approach in the past and it didn't give me better results and this solution was not recommended for loading problems

but I can try again, it is possible that I made some mistakes

Filipe Fernandes

не прочитано,
31 мар. 2020 г., 05:39:5431.03.2020
– str...@googlegroups.com
I say this, because did not find that package on npm, as you see, those plugins were done years ago, they should still work, but are not up do date with best pratices :)
Afaik that package is not in npm, and the package "strophe-plugins" is just a readme file, there is no code there :)
Hope that solves it for you

To unsubscribe from this group and stop receiving emails from it, send an email to strophe+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/strophe/209454d6-f1f9-4a9c-9f0f-474528bc2679%40googlegroups.com.

Maurizio Poli

не прочитано,
31 мар. 2020 г., 06:05:1131.03.2020
– Strophe

Filipe Fernandes

не прочитано,
3 апр. 2020 г., 11:10:0003.04.2020
– str...@googlegroups.com
Usualy more than 2 years is old, but thing is, this works, all plugins seem to work, using a bunch of them, some 7 years old and they work fine

To unsubscribe from this group and stop receiving emails from it, send an email to strophe+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/strophe/f1b5bc3b-865b-4a8e-b4a9-b509030a1269%40googlegroups.com.

Ответить всем
Отправить сообщение автору
Переслать
0 новых сообщений