ResultsDirect / LinkedIn-iPhone

Simple framework to provide authentication and API support for LinkedIn on iPhoneOS devices.
74 stars 27 forks source link

Active sessions #20

Open rahul11Victory opened 13 years ago

rahul11Victory commented 13 years ago

Hi, Can someone guide me how can i implement Active sessions in this code...?? Because every time i open the application (While testing on Simulator) i get the Linkedin Auth screen... Is there any way such that i dont have to Login multiple Times...

Regards, Rahul

sixten commented 13 years ago

First thing: if you're starting a new project, I'd recommend you consider using the unstable branch. Among other things, I've merged in the support from rhaining and others for logging out of LinkedIn.

When you complete the authorization process, the engine will hand you the access token, and it's up to you to store that someplace. When you create a new engine instance, it will ask you for any existing credentials. You can see this in action in the demo app. (Look for the RDLinkedInEngineDelegate section of DemoViewController.m.)

rahul11Victory commented 13 years ago

Hi, Thanks for the Help.I have one more question to ask, On the web, if user is already logged to Linkedin & we want to log into our app using linkedin account… It takes us to a Screen which displays Message as : Grant AppName access to your LinkedIn Account "UserName". Where we can continue,Revoke or cancel the Request. How is it possible to go to this "Grant Access" Screen in iphone….??

sixten commented 13 years ago

I'm not entirely sure which screen you mean. Can you provide a URL, or maybe a link to the documentation for the process you're using?

One problem you may run into is that iOS apps are sandboxed. So, even if the user has logged in to LinkedIn through Safari on their device, your app won't know anything about that.

On the other hand, these aren't web apps, so there's no need to authorize the user more than once: if you follow the example of the demo app, the end result is an access token that will be good for as long as the user wants it to be. Until it expires, you don't need to re-authorize them.