菜鸟教程小白 发表于 2022-12-13 16:05:58

ios - 使用 Linkedin SDK iOS 登录


                                            <p><p>我已经为登录过程实现了linkedin-sdk。在开发者帐户上创建 key 。以下是代码:</p>

<pre><code>    [LISDKSessionManager createSessionWithAuth:permissions state:nil showGoToAppStoreDialog:YES successBlock:^(NSString *returnState){
            NSLog(@&#34;%s&#34;,&#34;success called!&#34;);
            LISDKSession *session = [ session];
            NSLog(@&#34;Session: %@&#34;, session.description);
            }];
      } errorBlock:^(NSError *error) {
            NSLog(@&#34;Error called: %@&#34;, error);
      }];


func application(_ app: UIApplication, open url: URL, options: ) -&gt; Bool {

print(&#34;url..&#34;,url)

if LISDKCallbackHandler.application(app, open: url, sourceApplication: options as! String?, annotation: options) {
            return true
      }
}
</code></pre>

<p>url... li4366914://error?state=(null)&info=INVALID_APP_ID&domain=LISDKInvalidRequestError&description=Invalid%20Application%20ID</p>

<p>它转到 Linkedin 应用程序 <a href="/image/pv5TU.jpg" rel="noreferrer noopener nofollow"><img src="/image/pv5TU.jpg" alt="Linkedin authentication"/></a>但是当它回到应用程序时,显示无效 session 。找不到原因。浪费了几个小时。如果有人了解此错误,请帮助我。</p>

<p>谢谢!</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>LinkedIn SDK 已被弃用。</p>

<blockquote>
<p>The Mobile SDK is not currently supported. <a href="https://engineering.linkedin.com/blog/2018/12/developer-program-updates" rel="noreferrer noopener nofollow">Learn more</a></p>

<p><sub>Ref: <a href="https://developer.linkedin.com/docs/ios-sdk" rel="noreferrer noopener nofollow">https://developer.linkedin.com/docs/ios-sdk</a></sub></p>
</blockquote>

<p>“了解更多”将您带到 LinkedIn 的 <a href="https://engineering.linkedin.com/blog/2018/12/developer-program-updates" rel="noreferrer noopener nofollow">Developer Program Updates</a>其中指出:</p>

<blockquote>
<p>Changes to the program include:</p>

<ul>
<li>APIs: Developers must migrate their apps to our new APIs.

<ul>
<li>Sign In with LinkedIn: Sign In with LinkedIn enables members to choose a more convenient way to log-in to third party apps and allows those apps to learn more about their new user. This API will only recognize a new “Lite Profile” permission, which supports a reduced set of member profile fields. See the <a href="https://learn.microsoft.com/en-us/linkedin/consumer/integrations/self-serve/sign-in-with-linkedin?context=linkedin/consumer/context" rel="noreferrer noopener nofollow">documentation</a> for more details.</li>
</ul></li>
</ul>

<p>...</p>

<ul>
<li><p>Authentication, SDKs, and Plugins: We are also deprecating several obsolete or seldomly-used products and technologies.</p>

<ul>
<li><p>Authentication: We will sunset OAuth 1.0 and require all developers to use OAuth 2.0, which we have supported since 2013. OAuth 2.0 is the industry standard and widely-used by the majority of people building on our platform.</p></li>
<li><p><strong>SDKs: Our JavaScript and Mobile Software Development Kits (SDKs) will stop working. Developers will need to migrate to using OAuth 2.0 directly from their apps.</strong></p></li>
</ul></li>
</ul>

<p>...</p>

<p><strong>To reiterate: all developers need to migrate their apps to our newest APIs and OAuth 2.0 by March 1, 2019.</strong> To help navigate the migration process, please see the <a href="https://learn.microsoft.com/en-us/linkedin/consumer/integrations/self-serve/migration-faq?context=linkedin/consumer/context" rel="noreferrer noopener nofollow">technical migration guide</a> on the LinkedIn section of the Microsoft Docs website.</p>

<p><sub>Ref: <a href="https://engineering.linkedin.com/blog/2018/12/developer-program-updates" rel="noreferrer noopener nofollow">https://engineering.linkedin.com/blog/2018/12/developer-program-updates</a></sub></p>
</blockquote>

<hr/>

<h2>总结:</h2>

<p>SDK 很旧,不再维护。它一定是使用了已被丢弃的旧 API,我想这就是为什么即使您正确设置项目,SDK 也无法按预期工作。</p>

<h3>选项:</h3>

<ul>
<li>关注他们的<a href="https://learn.microsoft.com/en-us/linkedin/consumer/integrations/self-serve/sign-in-with-linkedin?context=linkedin/consumer/context" rel="noreferrer noopener nofollow">documentation on implementing v2 directly</a> </li>
<li>关注他们的<a href="https://learn.microsoft.com/en-us/linkedin/consumer/integrations/self-serve/migration-faq?context=linkedin/consumer/context" rel="noreferrer noopener nofollow">technical migration guide from v1 to v2</a> </li>
</ul></p>
                                   
                                                <p style="font-size: 20px;">关于ios - 使用 Linkedin SDK iOS 登录,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/55184816/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/55184816/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - 使用 Linkedin SDK iOS 登录