I’m starting to work with FB integration in my app and I’ve been reading a lot of info.
I’ve already downloaded the SDK and finished all the necessary steps to integrate the framework on my app. It’s already Facebook-ready.
Nevertheless there’s one thing I don’t have quite figured out. It’s something rather conceptual.
My app is really simple. Only a couple of screens and there is no backbone, web services, user accounts, etc. You basically put three options on cards and pick a card after shuffling. Nothing else.
Every starter tutorial on Facebook integration has the login section. Every example I’ve seen has the login button but I really don’t want to have a login button on my app. Just the “share” button.
What’s the best way to deal with this? Should I make the “share” button act like the “login” button first and then share the content? Will it know the next time that the user is already logged in and skip the login part somehow?
Which is the best road to follow here?
When posting, if not already logged in, you automatically go through the login process then post.
If your storing the retrieved login token, then you use this in future and you don’t need to log in again.
EDIT—–
The way I do it. I have a Facebook singleton class. On init of the singleton you set the facebook.accessToken to the accessToken that you store in NSUserDefaults when login is complete.
This way you can use the .isSessionValid method to decide whether to re-login again, or just post. If the user hasn’t been logged in yet, then the accessToken will be nil and therefore the session is not valid.
I hope this helps. If not, let me know.