2016-05-17 49 views
-1

如何在android應用程序中集成路徑以及如何提供OAuth2重定向URL。 我在成功驗證後回到應用程序時遇到問題,而在瀏覽器上進行重新直接路徑API驗證。
請儘快回覆,我會爲此感謝。如何在android中集成路徑社交網絡?

https://path.com/developers/docs#status

這是我的驗證碼

btn_share.setOnClickListener(new View.OnClickListener() { 
     @Override 
     public void onClick(View v) { 

      Log.i("MainActivity", "onCreate called"); 

      Uri uri = Uri.parse("https://partner.path.com/oauth2/authenticate?response_type=code&client_id=e1438845936c1e9dae8d3e0a5739028a73768fa9"); 

      Intent intent = new Intent(Intent.ACTION_VIEW,uri); 

      startActivityForResult(intent,101); 

      Log.i("MainActivity","startActivityForResult called");  

     } 
    }); 
} 

如何共享的「路徑社交網絡」後,請給我正確的代碼

+0

歡迎來到SO,在提問時請詳細一點:您嘗試過什麼,期望什麼等。請參閱[如何提問](http://stackoverflow.com/help/how-to-問) – Nehal

+0

謝謝,我想在我的android應用程序中集成Path Social Network,並且我閱讀了這個文檔https://path.com/developers/docs#status,但我不明白如何集成。 – user5829709

回答

0

希望您註冊了您的應用程序,並給了redirectUri成功登錄後要將其重定向到。

聲明此intent-filter在你的清單與相應的活動:

<intent-filter> 
      <action android:name="android.intent.action.VIEW" /> 

      <category android:name="android.intent.category.DEFAULT" /> 
      <category android:name="android.intent.category.BROWSABLE" /> 

      <data 
       android:host="t4jsample" 
       android:scheme="oauth" /> 
     </intent-filter> 

確保您redirectUri和方案+主機。即oauth://t4jsample這兩個匹配項。

+0

非常感謝你,你節省了我的時間。 – user5829709

+0

@ user5829709你可以upvote並接受我的答案,如果它幫助你:) –

+0

請給我一個更多的答案,如何將路徑社交網絡整合到android應用程序中並在Path中共享貼子。 – user5829709