【问题标题】:Linked-j.jar, getConnections() method return null alwayLinkedin.jar,getConnections() 方法总是返回 null
【发布时间】:2014-02-21 10:54:22
【问题描述】:

我正在使用linkedin-j.jar 来获取使用getProfileById methodLinkedIn Profile,但我无法获取来自getConnection() 方法的连接,它始终是return null

谁能帮我解决这个问题,下面是代码sn-p

Set<ProfileField> connectionFields = EnumSet.of(ProfileField.FIRST_NAME, ProfileField.LAST_NAME,ProfileField.CONNECTIONS)

Person person = client.methgetProfileById("id",connectionFields);
Connections conn = person.getConnections();

conn 变量为 null。

我也想知道,为什么它会变为空。

【问题讨论】:

    标签: linkedin-j


    【解决方案1】:

    请检查以下代码:

     final LinkedInApiClientFactory factory = LinkedInApiClientFactory
                .newInstance(BFF_CONSUMER_KEY, BFF_CONSUMER_SECRET);
                final LinkedInApiClient client = factory
                .createLinkedInApiClient(accessToken);
    
      Set<ProfileField> fields = EnumSet.of(ProfileField.ID,
              ProfileField.FIRST_NAME, ProfileField.LAST_NAME,ProfileField.CONNECTIONS);
    
      Person profile = client.getProfileForCurrentUser(fields);   
      Person person = client.getProfileById(profile.getId(),fields);
      Connections conn = person.getConnections();
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-08-16
      • 2016-07-10
      • 2016-02-10
      • 1970-01-01
      • 1970-01-01
      • 2016-03-31
      • 1970-01-01
      • 2012-08-01
      相关资源
      最近更新 更多