Page 1 of 1

arrowchat Mobile Integration not working

PostPosted: 19 Feb 2016, 08:10
by lmbuffetti
Hi,

I have a problem with arrowchat, version 1.8.3. I'm a web developer and I have a client that use the arrowchat on site developed with Wordpress, I didn't developed it. Now I should fix some problem of this site but I don't know how I can fix the following problem.

The chat works very well on desktop but on mobile when a user click on button to chat with other user on the console I have this error: jqac.arrowchat.chatWith is not a function. (In 'jqac.arrowchat.chatWith('205')', 'jqac.arrowchat.chatWith' is undefined).

The button to chat with user is: <a href="javascript:;" onclick="jqac.arrowchat.chatWith('205');" class="chat button">Chatta con me</a> where the 205 is the id of user.

How can I fix this problem?

Thanks

Re: arrowchat Mobile Integration not working

PostPosted: 02 May 2016, 01:21
by jcom
having the same problem

cannot work on mobile

Re: arrowchat Mobile Integration not working

PostPosted: 02 May 2016, 16:51
by jensrenner1980
Same problem for me, tested with 1.8.3 and 1.8.42.
The tab does not open when using Chrome on Android, but as soon as I enable "request desktop version" in mobile Chrome everything works as expected.

Re: arrowchat Mobile Integration not working

PostPosted: 02 May 2016, 17:54
by jensrenner1980
Could it be related to "arguments.callee" being deprecated, and the mobile Chrome browser not supporting it because it runs in a "light" or "strict" mode?

Re: arrowchat Mobile Integration not working

PostPosted: 03 May 2016, 00:36
by jcom
We need some solutions for that, please support... If not it's useless in mobile devices.

Re: arrowchat Mobile Integration not working

PostPosted: 03 May 2016, 09:15
by jensrenner1980
I've just set up a test case to reproduce the issue. I am using AC 1.8.42, a fresh install and a users table with 1: admin 2: test.
My page looks like this:
Code: Select all
<html>
<head>
<link type="text/css" rel="stylesheet" id="arrowchat_css" media="all" href="/arrowchat/external.php?type=css" charset="utf-8" />
<script type="text/javascript" src="/arrowchat/includes/js/jquery.js"></script>
<script type="text/javascript" src="/arrowchat/includes/js/jquery-ui.js"></script>
</head>
<body>
<a href="#" onclick="javascript:jqac.arrowchat.chatWith('1');">1</a>
<a href="#" onclick="javascript:jqac.arrowchat.chatWith('2');">2</a>
<script type="text/javascript" src="/arrowchat/external.php?type=djs" charset="utf-8"></script>
<script type="text/javascript" src="/arrowchat/external.php?type=js" charset="utf-8"></script>
</body>
</html>


This works with Chrome on both my desktop and mobile device, also with my desktop Chrome set to mobile emulation.
But as soon as enable "Chat Tab on Mobile Devices", it stops working on my smartphone and also in the emulation. The error I am getting is: "Uncaught TypeError: jqac.arrowchat.chatWith is not a function"

Maybe that helps. I wonder why the issue doesn't appear when "Chat Tab on Mobile Devices" is disabled.

Re: arrowchat Mobile Integration not working

PostPosted: 03 May 2016, 12:13
by Jason
The chatWith API will not work on mobile. We will be fixing this in the next update.

Re: arrowchat Mobile Integration not working

PostPosted: 03 May 2016, 13:28
by jensrenner1980
I developed a somewhat ugly hack that fixes this behaviour. You need to change 3 files.

In includes/js/arrowchat_mobile.js at line 309 (after arguments.callee.runarrowchat = runarrowchat;) add:
Code: Select all
                arguments.callee.chatWith = function (b) {
                        window.open(c_ac_path + 'public/mobile/?id='+b, 'mobiletab', '_blank');
                };
 


In public/mobile/includes/js/mobile_core.js at line 156 (before arguments.callee.videoWith=function(b){) add:
Code: Select all
arguments.callee.chatWith = function (b) {
        Oa(b);
};


In public/mobile/index.php at line 43 change <body> to
Code: Select all
<body <?php if (!empty($_GET['id'])) echo("onload=\"jqac.arrowchat.chatWith('".$_GET['id']."')\""); ?>>


It's far from perfect, but at least it opens the mobile tab and shows the user to chat with.

Re: arrowchat Mobile Integration not working

PostPosted: 06 May 2016, 01:29
by jcom
Much appreciated @JRenner22

the problem I have is that when opening the chat It shows the list of users and not opens the chatroom with the userid.. But that user appears at the bottom of the list, and when clicking over it it displays another username.

You face the same problem here?

Best!

Re: arrowchat Mobile Integration not working

PostPosted: 06 May 2016, 09:11
by jensrenner1980
You are right. Since the source code is a bit obfuscated, I can only guess what functions are meant to do.
So basically it's trial and error.
Please try to insert Xa(); before Oa(b); in public/mobile/includes/js/mobile_core.js
That seem's to fix it for me.

Re: arrowchat Mobile Integration not working

PostPosted: 07 May 2016, 01:19
by jcom
thanks again @JRenner22

I have it like you said but does the same, just opens the buddy list but not the actual chartoom with userid:

Code: Select all
arguments.callee.chatWith = function (b) {
    Xa();
    Oa(b);
};

Re: arrowchat Mobile Integration not working

PostPosted: 08 May 2016, 23:24
by jensrenner1980
jcom, that's true. Even though I tried a lot of things I didn't manage to scroll to the 2nd page where the actual conversation is shown.
It only fixes the issue of not showing the correct user when selecting the newly created conversation.

Re: arrowchat Mobile Integration not working

PostPosted: 08 May 2016, 23:34
by jcom
Well at least you managed that :) I'm using it appreciated.

hope the arrowchat team gets us the proper upate soon.

Re: arrowchat Mobile Integration not working

PostPosted: 07 Jul 2016, 05:55
by WLeonardo
Hi.

solved the problem..wasn't sending messages from windows phone.

There is a missing argument in the "arrowchat\public\mobile\includes\js\mobile_libraries.js" file
Search for:"this.sound.removeEventListener("ended");"
and replce with "this.sound.removeEventListener("ended",this._ended.bind(this));"
Hope someone can use it!