tonyli508 / LinkedinSwift

Linkedin IOS SDK for Swift from IOS 7
MIT License
74 stars 43 forks source link

LinkedIn Login if app not installed #27

Closed CoderNaveen closed 7 years ago

CoderNaveen commented 7 years ago

Login page appeared with my app name. It'll work fine if I put wrong password for my email id. But when I put correct password. I got this error in my console:

2017-07-12 18:33:47.351186+0530 MyApp[xxxxx:xxxxxx] [MobileAssetError:29] Unable to copy asset information from https://mesu.apple.com/assets/ for asset type com.apple.MobileAsset.TextInput.SpellChecker 2017-07-12 18:33:48.127 MyApp[xxxxx:xxxxxx] WebKit discarded an uncaught exception in the webView:decidePolicyForNavigationAction:request:frame:decisionListener: delegate: -[NSTaggedPointerString rangeOfString:options:range:locale:]: nil argument

Interesting thing is that, it will work fine if I used in a device where LinkedIn app is installed.

CoderNaveen commented 7 years ago

I found the mistake in this. Actually the creators must point this in Readme. Here's the devil :

let linkedinHelper = LinkedinSwiftHelper(configuration: LinkedinSwiftConfiguration( clientId: LINKED_IN_KEY, clientSecret: LINKED_IN_SECRET, state: "linkedin(Int(NSDate().timeIntervalSince1970))",/I am previously using this state:nil/ permissions: ["r_basicprofile", "r_emailaddress"], redirectUrl: "https://\(REDIRECT_URL).oauth") )

So it will doing fine if app is installed even if not it will opening the LinkedIn page and If I put wrong password for my Id it will shows me the error "Wrong password" but whenever I use right the API return nil in response. I am clueless about it. But finally from checking each every single term I got to know that I've to put state for getting token in web view.