3

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

Byron Rode
  • 525
  • 5
  • 15
user3706153
  • 191
  • 2
  • 8
  • Hey there. First of all - please check out the latest version of the SDK: https://github.com/QuickBlox/quickblox-javascript-sdk - makes chat stuff a whole lot simpler. Second - if you'd like, please send your project to alex.bassquickblox.com and I'll be happy to take a look. – Alex Bass Jan 01 '15 at 14:16

0 Answers0