I am creating an app for Facebook and twitter integration using sharekit. That works fine. But now I want to retrieve the username and password for facebook login. I followed this link.
But I am not able to retrieve these..
I can’t understand how can use that method and where can i use to retrieve username and password
Can you please guide me if you know.
First of all, you can’t retrieve a user’s Facebook password. Hopefully the reasons for this are obvious.
You can, however, retrieve the access token that your app is granted once you connect your app to a user’s Facebook account using ShareKit.
As of this writing, I don’t believe ShareKit makes the access token accessible directly, but there’s an easy hack to retrieve it.
Step 1: Ensure that you’re app is authorized to connect to Facebook
If you get
isConnected == NOhere, your UI should indicate that the user needs to connect to Facebook to use your sharing features.Step 2: Get the access token in order to access the user’s Facebook data
Assuming you got
isConnected == YESin step 1Step 3: Bypass ShareKit and make a custom query to the Facebook SDK
Assuming a property in your class such as this one…
…you can start a Facebook query with something like this…
Step 4: Implement the Facebook delegate methods
Once the Facebook query’s done, it’ll notify your object, at which point you can do fancy things such as display the user’s name to make it clear whose wall will get posts sent from your app.
You’ll need to declare the
FBRequestDelegateprotocol in your .h, of course:And you’ll need to implement (minimally) the success and failure methods from FBRequestDelegate: