Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

How to check if user clicked “ignore” when asked for an application to be authorized?

$
0
0

This is the facebook login event handler :

function facebookLoginHandler(e) {
 
        Ti.API.error("--)))+++   e.success   : "+e.success);
 
        if (e.success) {
 
            Ti.API.error("fb login success");
            Ti.API.info('user id ' + facebook.uid);
 
 
            //SELECT uid,first_name,last_name,sex,pic_square,email,birthday_date,current_address,current_address.street,current_address.city,current_address.country,current_address.zip,email,last_name,locale,sex,pic,pic_big,pic_small,profile_url FROM user WHERE uid=me()
 
            facebook.request('fql.query', {query: "SELECT first_name,last_name,sex,email,birthday_date,profile_url FROM user WHERE uid="+facebook.uid
                },  function(r) {
 
                    Ti.API.error("facebook.request CallBack fn is RUNNING");
                    Ti.API.info('r.success ' + r.success);
 
 
                    Ti.API.error("--)))+++   r.success   : "+r.success);
 
            if (!r.success) {
                if (r.error) {
                    alert(r.error);
                } else {
                    alert("call was unsuccessful");
                }
                return;
            } else {
                var result = JSON.parse(r.result);
 
            Ti.API.info('r.result ' + r.result);
 
            Ti.API.info('result[0].email : ' + result[0].email);
            Ti.API.info('result[0].profile_url : ' + result[0].profile_url);
            Ti.API.info('result[0].sex : ' + result[0].sex);
            Ti.API.info('result[0].birthday_date : ' + result[0].birthday_date);
            Ti.API.info('result[0].last_name : ' + result[0].last_name);
            Ti.API.info('result[0].first_name : ' + result[0].first_name);
 
            if (Titanium.Network.networkType === Titanium.Network.NETWORK_NONE) {
 
               alert(L('indisp_cnnx_msg'));
            } else {
                //////  
                //  le controller suivant est  global scopped pour pouvoir l'annuler une fois on a plus besoin!!
                // c'est pas CON
                /////   
                Alloy.Globals.getJsonArrayByHttpCtrl = Alloy.createController('getJsonArrayByHttp');
                Alloy.Globals.getJsonArrayByHttpCtrl.getJsonArrayByHttp("userHasAccreq", "ws-bookmynight.php?op=verifyUser&email="+result[0].email+"&fb="+result[0].profile_url);
            }
            }
 
 
 
 
            // for (var c=0;c<result.length;c++)
            // {
                // var row = result[c];
                // Ti.API.info('c  : ' + c);
                // Ti.API.info('row[0].first_name  : ' + row.first_name);
            // Ti.API.info('row[0].last_name : ' + row.last_name);
            // Ti.API.info('row[0].birthday_date : ' + row.birthday_date);
            // Ti.API.info('row[0].profile_url : ' + row.profile_url);
            // Ti.API.info('row[0].email : ' + row.email);
            // Ti.API.info('row[0].sex : ' + row.sex);
            // }
 
            // for (var c=0;c<result[0].length;c++)
            // {
                // Ti.API.info('result['+c+'] ' + result[c]);
                 // //var row = result[c];
            // }
 
        });
 
        } else if (e.error) {
            // Error!
        } else if (e.cancelled) {
            // cancelled by user
        }
    }
i was expecting when the user clickes on the "ignore" button when he is asked to authorize the application but the "e.success" is always set to true wether "ignore" or "Ok" are clicked.

Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>