Jaxl not doing anything using example. Facebook Chat attempt
Asked Answered
N

1

7
      $jaxl = new JAXL(array(  
            'user'=>'[email protected]',  
            'pass'=>'', // Not required, we will use user session key instead  
            'host'=>'chat.facebook.com',  
            'domain'=>'chat.facebook.com'  
    ));  
            function getFacebookKey() {
            global $session;
              global $app_secret,$api_key;
                            return array(  
                                    $app_secret, // Your application secret key  
                                    $api_key, // Your application api key  
                                    $session['session_key'] // Connecting user session key  
                            );  
                    }  


            function doAuth($mechanism) {  
            global $jaxl;  
            $jaxl->auth("X-FACEBOOK-PLATFORM");  
    }  


        function postAuth($payload, $jaxl) {
            var_dump($jaxl);
            $jaxl->sendMessage('[email protected]', 'what up');


        }

// Register callback on required hook (callback'd method will always receive 2 params)
$jaxl->addPlugin('jaxl_post_auth', 'postAuth');

$jaxl->addPlugin('jaxl_get_facebook_key', 'getFacebookKey');
// Start Jaxl core
$jaxl->startCore('stream');

    exit;

Nothing is outputing or showing up in the jaxl log. Any help would be greatly appreciated.

Nucleolar answered 3/4, 2011 at 21:7 Comment(9)
Hi Arian, Kindly pass logLevel=4 with Jaxl constructor to enable logging. Also error_reporting can be used for more verbose error if any related to ur php setup.Palladin
Even with logLevel=>4 jaxl.log remains empty.Nucleolar
also i have error_reporting set to everything, even warnings.Nucleolar
how exactly are you running your application from command line? Also just after Jaxl initialization can you do var_dump($jaxl); to see if you are actually initializing everything properly. Also what php/jaxl version are you using?Palladin
Hi! not from the command line. It's via hosted.Nucleolar
well then u shd make use of bosh or preFetch sample examples. Echobot or packaged fb app is a command line app and won't run from browser directlyPalladin
derp derp derp derp on me . Put that as an answer here and i'll up it.Nucleolar
It packages with Jaxl library... go inside /app directory and you will find two file preFetchXMPP.php and preFetchBOSH.php You can use one of them based on ur need....Palladin
Are theese $app_secret,$api_key set anywhere?Pattiepattin
L
1

You may need to create the log file and given it wide open permissions...

sudo touch /var/log/jaxl.log

sudo chmod 777 /var/log/jaxl.log

Leaves answered 24/2, 2012 at 19:43 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.