0

アクセス トークンが null でない場合にのみ、この set tweet 関数を呼び出しています。コードのその部分は正常に機能しており、トークンが null の場合に認証画面が表示されます。ただし、この setTweet 関数では、最初のアラート以外のアラートが表示されません。何が問題なのか教えてもらえますか?

var Codebird3 = require("codebird");

var cb3 = new Codebird3();

cb3.setConsumerKey('correctTokenHere', 'AndHere');

function setTweet(){
alert('In setTweet function');
       var tweet = 'I have just scored '+ globalPts +' points playing Clash of the Classics. Test your knowledge of the classic hits and see if you can beat my score. https://www.facebook.com/ClassicHits4FM/app_199377276878657';
        cb3.__call(
            "statuses_update",
                {"status": tweet },
                    function (reply) {
                    alert('In here');
                    function inspeccionar(obj){
                        alert('in reply part');
                        var msg = '';
                        for (var property in obj){
                            if (typeof obj[property] == 'function')
                            {
                                var inicio = obj[property].toString().indexOf('function');
                                var fin = obj[property].toString().indexOf(')')+1;
                                var propertyValue=obj[property].toString().substring(inicio,fin);
                                msg +=(typeof obj[property])+' '+property+' : '+propertyValue+' ;\n';
                            }
                            else if (typeof obj[property] == 'unknown')
                            {
                                msg += 'unknown '+property+' : unknown ;\n';
                            }
                            else
                                {
                                    msg +=(typeof obj[property])+' '+property+' : '+obj[property]+' ;\n';
                                }
                        }
                        return msg;
                        }

                        alert(inspeccionar(reply)); 
                        alert(reply.httpstatus);

                        if(reply.httpstatus == 200){
                                alert("Tweet sent!");
                                twitterBtn.setBackgroundImage('twitterShare_blue.png');

                         }
                         else{
                                alert(reply.errors);
                                //alert('Connection lost');
                         }
                }
        );
    //});
}

PS奇妙なことは、このアプリの別のjsにまったく同じ機能があり、それが機能することです。私は、これらの目的のために基本的に単なるjavascriptであるTitaniumを使用しています

4

1 に答える 1

0

ツイートが 160 文字に制限されていることがわかりました。

于 2013-10-18T11:26:36.443 に答える