2015-09-06 64 views
12

我在连接Linkedin API时遇到了一些问题。Linkedin Android SDK - 无法连接到API(INVALID_REQUEST)

我下面这个https://developer.linkedin.com/docs/android-sdkhttps://developer.linkedin.com/docs/android-sdk-auth,但我得到这个错误代码:

{ 
"errorCode": "INVALID_REQUEST", 
"errorMessage": "either bundle id or package name \/ hash are invalid, unknown, malformed" 
} 

我实现到目前为止是非常简单的:

public void shareOnLinkedin() { 

    AuthListener authListener = new AuthListener() { 
     @Override 
     public void onAuthSuccess() { 
      Log.d(TAG, "Success"); 
     } 

     @Override 
     public void onAuthError(LIAuthError error) { 
      Log.d(TAG, error.toString()); 
     } 
    }; 

    LISessionManager 
      .getInstance(getApplicationContext()) 
      .init(ColectionDetailActivity.this, buildScope(), authListener, true); 
} 

private static Scope buildScope() { 
    return Scope.build(Scope.R_BASICPROFILE, Scope.W_SHARE); 
} 

@Override 
protected void onActivityResult(int requestCode, int resultCode, Intent data) { 
    ... 

    try { 
     LISessionManager.getInstance(getApplicationContext()) 
       .onActivityResult(this, requestCode, resultCode, data); 
    } catch (Exception e) { 
     e.printStackTrace(); 
    } 
} 
+0

你可能会发现这些有用的http://stackoverflow.com/questio ns/29787977/android-linkedin-mobile-sdk-error http://duladissa.blogspot.com.au/2015/03/android-linkedin-sdk-100-usage.html让我知道你是否需要更多帮助。 –

+0

可能是系统时间问题..检查你的移动时间.. – uday

+0

同样的问题在这里,不能得到这个工作,也没有发现任何有用的:-(。 –

回答

2

确保您已在LinkedIn开发人员控制台中正确添加了所有包装散列。

Generating a debug key hash value


这下移动和看起来像这样,

应用的程序包将使用LinkedIn的SDK:com.mypackage.app

生成程序包哈希值:/i17lYLZpSffk1wdD+KzlRJroZU=

+0

这是根据文档完成,但仍然无法正确连接。 – FeleMed

+0

请确保添加所有密钥哈希值:您团队中所有开发人员的debug.keystore以及您的发行密钥库 只需确保您的应用程序使用与生成的密钥库相同的密钥库进行签名,已被添加到LinkedIn的开发者控制台中 – deubaka

+0

感谢您的回复,实际上我已经根据文档添加了包名和包名,实际上您必须使用facebook SDK进行相同的配置步骤,而且它正在使用相同的PackageName和散列,但我仍然得到这个错误。 – FeleMed