我正在将LinkedIn Login集成到我的应用中,但这给我一个错误
这是身份验证代码
private static Scope buildScope() {
return Scope.build(Scope.R_BASICPROFILE, Scope.R_EMAILADDRESS, Scope.W_SHARE);
}
public void signInWithLinkedIn() {
//First check if user is already authenticated or not and session is valid or not
if (!LISessionManager.getInstance(this).getSession().isValid()) {
//if not valid then start authentication
LISessionManager.getInstance(getApplicationContext()).init(this, buildScope()//pass the build scope here
, new AuthListener() {
@Override
public void onAuthSuccess() {
//on successful authentication fetch basic profile data of user
fetchBasicProfileData();
}
@Override
public void onAuthError(LIAuthError error) {
// Handle authentication errors
Log.e(TAG, "Auth Error :" + error.toString());
Toast.makeText(mContext, "Failed to authenticate with LinkedIn. Please try again.", Toast.LENGTH_SHORT).show();
}
}, true);//if TRUE then it will show dialog if
// any device has no LinkedIn app installed to download app else won't show anything
} else {
Toast.makeText(this, "You are already authenticated.", Toast.LENGTH_SHORT).show();
fetchBasicProfileData();
}
}
这是错误:-
验证错误:{ “ errorCode”:“ UNKNOWN_ERROR”, “ errorMessage”:“传入的移动标识符无效\” com.tablefortwo \“” }