我已经为登录过程实现了linkedin-sdk。在开发者帐户上创建 key 。以下是代码:
[LISDKSessionManager createSessionWithAuth:permissions state:nil showGoToAppStoreDialog:YES successBlock:^(NSString *returnState){
NSLog(@"%s","success called!");
LISDKSession *session = [[LISDKSessionManager sharedInstance] session];
NSLog(@"Session : %@", session.description);
}];
} errorBlock:^(NSError *error) {
NSLog(@"Error called : %@", error);
}];
func application(_ app: UIApplication, open url: URL, options: [UIApplicationOpenURLOptionsKey : Any]) -> Bool {
print("url..",url)
if LISDKCallbackHandler.application(app, open: url, sourceApplication: options[UIApplicationOpenURLOptionsKey.sourceApplication] as! String?, annotation: options[UIApplicationOpenURLOptionsKey.annotation]) {
return true
}
}
url... li4366914://error?state=(null)&info=INVALID_APP_ID&domain=LISDKInvalidRequestError&description=Invalid%20Application%20ID
它转到 Linkedin 应用程序 但是当它回到应用程序时,显示无效 session 。找不到原因。浪费了几个小时。如果有人了解此错误,请帮助我。
谢谢!
Best Answer-推荐答案 strong>
LinkedIn SDK 已被弃用。
The Mobile SDK is not currently supported. Learn more
Ref: https://developer.linkedin.com/docs/ios-sdk
“了解更多”将您带到 LinkedIn 的 Developer Program Updates其中指出:
Changes to the program include:
- APIs: Developers must migrate their apps to our new APIs.
- 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 documentation for more details.
...
...
To reiterate: all developers need to migrate their apps to our newest APIs and OAuth 2.0 by March 1, 2019. To help navigate the migration process, please see the technical migration guide on the LinkedIn section of the Microsoft Docs website.
Ref: https://engineering.linkedin.com/blog/2018/12/developer-program-updates
总结:
SDK 很旧,不再维护。它一定是使用了已被丢弃的旧 API,我想这就是为什么即使您正确设置项目,SDK 也无法按预期工作。
选项:
关于ios - 使用 Linkedin SDK iOS 登录,我们在Stack Overflow上找到一个类似的问题:
https://stackoverflow.com/questions/55184816/
|