Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

Combining iOS app with PHP back-end

I'm currently working on a project using iOS and Facebook SDK and Parse as a back-end. I use Parse convenience functions with its Facebook integration to handle user sign-up/log-in.

It's incredibly convenient and I'm very happy with it.

However, Parse as a back-end may not always be the best approach to this app depending on transaction volume vs revenue. And if that happens, I'm going to need to move quickly, so I'm spending some time on the side working on a PHP back-end in my dev environment. But I'm wondering how to piece the front-end and back-end together.

I can use the iOS Facebook SDK to handle authorisation, but I need to integrate my back-end into the process.

I'll need to create a user entry in my database and associate it with the Facebook credentials. Additionally, I'll want to make sure that every web api I expose performs the appropriate authentication as they will not be public (outside of the app and registered users).

Just wondering if anyone has implemented anything like this and if so, what the strategy was.

(Not ready to start thinking about data migration strategies yet - initially just a replication of functionality)

2 Answers

If you're trying to migrate from a Parse back-end to your own, you're basically rebuilding Parse. I think that might be out of the scope of a single post.

Why can't you just write your program in Parse?

If you're trying to migrate from a Parse back-end to your own, you're basically rebuilding Parse. I think that might be out of the scope of a single post.

Why can't you just write your program in Parse?

As was stated in the question, I'm allowing for the scenario where Parse is no longer possible or practical for whatever reason. Perhaps it wasn't clear, but my question is not looking for advice for the complete migration of functionality (or data). I was looking for some advice on authentication/authorisation using Facebook with iOS and a PHP back-end. Eg. should I try and implement the entire piece in the back-end with the Facebook SDK for PHP or should I use the Facebook iOS SDK and then communicate the credentials to the PHP back-end - and what would be the best way of doing that.