i'm tring to implement quickblox chat in my ios App but it doesn't work. I'm using ionicframework
in my index i have:
<script src="/libs/jquery/1.11.2/jquery.min.js"></script>
<script src="/lib/quickblox/quickblox.js"></script>
<script src="/lib/quickblox/quickblox.chat.js"></script>
my controller is:
var params, chatUser, chatService;
params = {login: 'xxxxxx', password: 'xxxxxx'};
QBAPP = {
appID: xxxxxx,
authKey: 'xxxxxx',
authSecret: 'xxxxxx'
}
QB.init(QBAPP.appID, QBAPP.authKey, QBAPP.authSecret);
console.log('step1')
// QuickBlox session creation
QB.createSession(params, function(err, result) {
console.log('step2')
if (err) {
console.log(err.detail);
} else {
chatUser = {
id: result.user_id,
pass: params.password
};
connectChat();
}
});
function connectChat() {
chatService = new QBChat({onConnectFailed: onConnectFailed,
onConnectSuccess: onConnectSuccess,
onConnectClosed: onConnectClosed
});
// connect to QB chat service
chatService.connect(chatUser);
}
/* Callbacks
------------------------------------------------------*/
// Connection is failed
function onConnectFailed() {console.log('doh')}
// Connection is success
function onConnectSuccess() {console.log('happy')}
// Connection is closed
function onConnectClosed() {}
if i test this on browser everything is ok, but when I test on the ios simulator nothing work and the console doesn't show any error. It stop at step1. any Ideas? thanks