我已经成功地整合了facebook,使用社交网站twitter,但是我在整合google +整合时遇到了问题,我可以登录,但是不能分享任何东西。
错误:- org.brickred.socialauth.exception.SocialAuthException: java.io.FileNotFoundException:https://accounts.google.com/o/oauth2/token
如果有人有想法,请回复。
提前谢谢..。
我使用的代码如下:
身份验证:-
SocialAuthAdapter googlePlusAdapter;
try
{
googlePlusAdapter = new SocialAuthAdapter(new ResponseListener());
googlePlusAdapter.addCallBack(Provider.GOOGLEPLUS, "http://localhost");
googlePlusAdapter.authorize(this,org.brickred.socialauth.android.SocialAuthAdapter.Provider.GOOGLEPLUS);
} catch (Exception e) {
Toast.makeText(getApplicationContext(),"Exception " + e.toString(), 1).show();
}共享:-
try{
String msg="post from my app";
googlePlusAdapter.updateStatus(msg, new SocialAuthListener<Integer>() {
@Override
public void onExecute(String arg0, Integer t) {
// TODO Auto-generated method stub
Integer status = t;
if (status.intValue() == 200 || status.intValue() == 201 ||status.intValue() == 204)
{ Toast.makeText(getApplicationContext(), "Message posted",Toast.LENGTH_LONG).show();
googlePlusAdapter.signOut(Provider.GOOGLEPLUS.toString());
}
else
Toast.makeText(getApplicationContext(), "Message not posted",Toast.LENGTH_LONG).show();
}
@Override
public void onError(SocialAuthError error) {
// TODO Auto-generated method stub
Toast.makeText(getApplicationContext(), "Message not posted!! Try again",Toast.LENGTH_LONG).show();
}
}, true);
finish();
}
catch(Exception e)
{
}发布于 2014-01-22 17:47:34
问题是您已经为Android应用程序创建了一个客户机ID。您必须为web应用程序创建一个客户端ID,然后在该选项中您必须使用一个redirect_uri。
步骤:
所以在你的代码中:
googlePlusAdapter.addCallBack(Provider.GOOGLEPLUS, "http://localhost");你必须这样写:
googlePlusAdapter.addCallBack(Provider.GOOGLEPLUS, same_uri_you_put_in_redirect_uri);这是因为社交网站通过http认证。
https://stackoverflow.com/questions/20288079
复制相似问题