2011-12-21 29 views
1

我試圖使用Facebook Credits的,但我得到這個錯誤:爲什麼收到此錯誤:您正在使用的應用程序沒有響應。請稍後再試

「你正在使用沒有響應的應用程序,請稍後再試。」

我不知道是什麼原因爲何,

我看了看螢火控制檯,看到採取類似40秒長的一些請求,這些請求的目標是:HTTP:// 0 -if-w.channel.facebook.com/pull?channel=p_685255507 & SEQ = 3 &客戶端ID = 25523dd1 & CB = gcgh &空閒= 41 &狀態=活躍

有沒有人有一個想法,我在做什麼錯誤?

這是我的html代碼:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" 
     xmlns:og="http://ogp.me/ns#" 
     xmlns:fb="http://www.facebook.com/2008/fbml"> 
<head> 
    <title>Facebook Credits Demo Application</title> 
    <meta property="og:title" content="yosi" /> 
    <meta property="og:type" content="game" /> 
    <meta property="og:url" content="http://localhost/ff_without/Facebook/default.aspx" /> 
    <meta property="og:image" content="http://apps.facebook.com/yositestmylife/Media/Images/credit.png" /> 
    <meta property="og:site_name" content="life2d0001" /> 
    <meta property="fb:admins" content="685000507" /> 
    <meta property="og:description" 
      content="A group of U.S. Marines, under command of 
        a renegade general, take over Alcatraz and 
        threaten San Francisco Bay with biological 
        weapons."/> 
    <script type="text/javascript" src="http://connect.facebook.net/en_US/all.js"> 
    </script> 
</head> 
<body> 
    <h2> 
     Facebook Credits Demo Application</h2> 
    <p> 
     Create an order by specifying the following attributes:</br> <i>Title, price, description, 
      image URL and product URL</i></p> 
    <!-- Please note that user can change any information in order_info through 
    javascript. So please make sure you never put price or any other 
    information you don't want users to modify in order_info. We put everything 
    here only for end-to-end flow testing purpose!! --> 
    <form name="place_order" id="order_form" action="#"> 
    Title: 
    <input type="text" name="title" value="BFF Locket" id="title_el" /> 
    <br /> 
    <br /> 
    Price: 
    <input type="text" name="price" value="10" id="price_el" /> 
    <br /> 
    <br /> 
    Description: 
    <input type="text" name="description" size="64" value="This is a BFF Locket..." id="desc_el" /> 
    <br /> 
    <br /> 
    Image URL: 
    <input type="text" name="image_url" size="64" value="http://localhost/ff_without/media/images/credit.png" 
     id="img_el" /> 
    <br /> 
    <br /> 
    Product URL: 
    <input type="text" name="product_url" size="64" value="http://localhost/ff_without/facebook/Credit_buy.aspx" 
     id="product_el" /> 
    <br /> 
    <br /> 
    <a onclick="placeOrder(); return false;"> 
     <img src="http://www.facebook.com/connect/button.php?app_id=<%=appID%>&feature=payments&type=light_l"> 
    </a> 
    </form> 
    <div id="output"> 
     <%=htmlResponse%> 
    </div> 
    <br/><br/> 
    <div id="fb-root"> 
    </div> 
    <script type="text/javascript"> 
    FB.init({appId: <%=appID%>, status: true, cookie: true}); 

    function placeOrder() { 
     var title = document.getElementById('title_el').value; 
     var desc = document.getElementById('desc_el').value; 
     var price = document.getElementById('price_el').value; 
     var img_url = document.getElementById('img_el').value; 
     var product_url = document.getElementById('product_el').value; 

     // Only send param data for sample. These parameters should be set 
     // in the callback. 
     var order_info = { "title":title, 
         "description":desc, 
         "price":price, 
         "image_url":img_url, 
         "product_url":product_url 
         }; 

     // calling the API ... 
//  var obj = { 
//  method: 'pay', 
//  order_info: order_info, 
//  purchase_type: 'item' 
//  }; 
     var obj = { 
      method: 'pay', 
      order_info: order_info, 
      purchase_type: 'item', 
      dev_purchase_params: {'oscif': true} 
     }; 
     FB.ui(obj, callback); 
    } 

    var callback = function(data) { 
    //alert('ghg'); 
     if (data['order_id']) { 
     writeback("Transaction Completed! </br></br>" 
     + "Data returned from Facebook: </br>" 
     + "<b>Order ID: </b>" + data['order_id'] + "</br>" 
     + "<b>Status: </b>" + data['status']); 
     } else if (data['error_code']) { 
     writeback("Transaction Failed! </br></br>" 
     + "Error message returned from Facebook:</br>" 
     + data['error_message']); 
     } else { 
     writeback("Transaction failed!"); 
     } 
    }; 

    function writeback(str) { 
     document.getElementById('output').innerHTML=str; 
    } 

    </script> 
</body> 
</html> 

回答

1

這可能是因爲

  • 最長執行時間爲您的文件不太
  • 當你的服務器(callback url)不響應發回正確的JSON出現此錯誤請確保這些格式的迴應是正好,並且一切都應該正常工作
  • 或您請求的服務器可能會面臨停機時間
0

如果使用的是從Facebook文檔的callback.php樣品然後註釋出像26,32和線44

這將結束在這種情況下的誤差。


// if ($item_id == '1a') { 
    $item = array(
     'title' => '100 some game cash', 
     'description' => 'Spend cash in some game.', 
     // Price must be denominated in credits. 
     'price' => 10, 
     //'image_url' => 'http://some_image_url/coin.jpg', 
    ); 

    // Construct response. 
    $response = array(
        'content' => array(
           0 => $item, 
           ), 
        'method' => $request_type, 
       ); 
    // Response must be JSON encoded. 
    $response = json_encode($response); 
    //} 
相關問題