2012-05-26 47 views
0

我遇到的問題是爲我的應用程序獲取公共訪問令牌。我收到以下錯誤: 05-26 14:43:17.194:D/Mobli(1219):響應{「error」:「invalid_request」,「error_description」:「請求包含不受支持的參數」,「error_uri」 :「http://dev.mobli.com/error/invalid_request」}爲Mobli獲取公共訪問令牌的錯誤

,我使用,使該請求的代碼如下:

Mobli mobli = new Mobli(ID, SECRET); 
SampleRequestListener mobliListner = new SampleRequestListener(); 
runner = new AsyncMobliRunner(mobli); 
runner.obtainPublicToken(mobliListner, null); 

public class SampleRequestListener extends BaseRequestListner { 
    public void onComplete(final String response, final Object state) { 
     try { 
      // process the response here: executed in background thread 
      Log.d("Mobli", "Response " + response.toString()); 
     } catch (MobliError e) { 
      Log.w("Mobli Error", "Error" + e.getMessage()); 
     } 
    } 
} 

任何想法可能是錯誤的碼?

我也已驗證網址形成正確。我得到util.java中的filenotfoundexcetion

回答

1

原來,在作爲mobli sdk的一部分的util.java中的openUrl函數中存在一個問題。在openUrl函數中,一個額外的參數被追加到post請求上,這導致了上述錯誤。具體來說,在openUrl函數中註釋掉以下幾行解決了上述問題。

// use method override 
if (!params.containsKey("method")) { 
    params.putString("method", method); 
} 
相關問題