Uncaught (в обещании): ReferenceError: Строфа не определена - PullRequest
0 голосов
/ 08 октября 2018

Почему я получаю Strophe не определено этот тип ошибки, когда я правильно устанавливаю Strophe согласно решению в этой ссылке: https://forum.ionicframework.com/t/integrate-quickblox-in-ionic-2/81726

Сначала я установилиспользуя strophe.js, npm install strophe.js

, затем установите Strophe, используя npm install strophe

, затем добавьте в файл index.html: скриптsrc = "strophe.js"

и код файла .ts:

import * as $ from "jquery";
import * as quickblox from "quickblox";
import * as Strophe from 'Strophe';

CREDENTIALS:any = {
 appId: 73870,
 authKey: 'ffzhPELMPfcZ8ZK',
 authSecret: '7a-VJ6dsBNT77t7'
};

user:any = {
 id: 24786158,
 login: 'test',
 pass: 'qwerty1234'
};

quickblox.init(this.CREDENTIALS.appId, this.CREDENTIALS.authKey, this.CREDENTIALS.authSecret);
quickblox.createSession(
  {login: this.user.login, password: this.user.pass},
  (err, result) => { //THIS LINE HAS BEEN CHANGED <-
    if (result){
      quickblox.chat.connect(
        {userId: this.user.id, password: this.user.pass},
        (err, roster) => { //THIS ONE TOO <-
          if (err){
            console.log(err);
          }
        });
    }       
    console.log(err);
    console.log(result);
});

if anybody have solution to solve this issue, please help me here.
...