Working on an iOS app that will use Dropbox as a server side ( just a place to store documents that the app needs to access). Most work I see around Dropbox API is asking the user to go and login from the iOS app into Dropbox, and then get the user token and save it, But I don;t ant that, I want to have a token stored within the app at all times. How can I achieve that? is that possible or a good practice.
Related
I am trying to create an IOS application. Part of it will allow upload of data to a Dropbox account that is hardcoded. I don't know how to do this part of my app without having a webpage show up that asks for authorization. Are there other ways to authorize an account without asking the user?
Don't do this. You're asking for a disaster.
Violates the Dropbox Terms of Service.
What happens when Dropbox suspends your account, your app breaks.
An API key you hide in the app could be compromised and exploited.
Look into another service intended for what you actually want to accomplish, Amazon's S3 is likely a good choice.
I am working on integrating dropbox with iOS application. I want to implement below functionality.
User can share his existing dropbox file with app.
If user modifies any of the files, i should able to fetch the updated file and notify app server.
Also these files are not app related ones. User can share any docs in his dropbox account with app
After going through API, i found that i can use dropbox chooser UI to share files. chooser is generating temporary URL which i can share with my server to extract the file from dropbox.
But to get the modified files, i have to integrate with OAuth permission to run delta query on dropbox account. Here i am struck with two parallel functionalities chooser and OAuth which seems not related to each other. Even while asking OAuth permission also, dropbox taking to web url to grant permission instead of showing already logged in user on iOS.
How do i verify both chooser account and OAuth granted account are same? How will i show dropbox chooser(of OAuth connected) when user wants to add any file to app?
Correct me if i am wrong in understanding dropbox API. Also let me know if i have to provide more details.
I'm new to Facebook development and I'm running into trouble with what seems like it should be an easy task. I am building an iOS app for a client, and that client wants to display a number of their most recent status updates in the app, along with a link to their Facebook page. These statuses should be displayed to the user of the app even if they are not logged into Facebook or do not have a Facebook account saved on their device.
My research so far seems to indicate that I'll need to make a request to the Graph API using a user access token (which I can do successfully in the app using a token copied and pasted from the Graph API Explorer), but it seems that the only way to get a user access token from within the app is to log the user of the app into Facebook using their account credentials. This is not a good solution because I need to be able to display the client's statuses to the user whether they have are logged into a Facebook account or not. Is such a thing possible, and if so, how? I've been all over the docs and can't find a conclusive answer either way.
I know that we would approach it quite differently. We would have our own web service periodically pull what we needed off of google and store it on our own server, then we would use AFHTTPClient to pull this information down to our app. That way we wouldn't have to spoof anything with FaceBook or put any requirments on our users, such as logging into facebook. It would require that you have a service that your client maintains (or you could easily contract that for a cost).
we are developing an iOS App using Adobe Flex/Air. The app uses a web service that needs user authentication via facebook login. At the moment, we use server side authentication: There's a login URL displayed in a WebView where the facebook login is done. This way, we get an access_token that can be used on the server side.
This works perfectly but it would really be much better if we could use Single Sign-on with the facebook ios app. As far as I have read, this should work on the client side but I haven't found a way to authenticate the user on the server side.
facebook's access_tokens are valid either for use on the server-side or for the client side so an access_token from the client-side login won't work for the server side.
Thanks in advance for your ideas,
Henk
As far as I can see, you're making this far more complicated than it's really intended to be. Leverage the Facebook iOS SDK, and all of the heavy lifting involved with authenticating the user within your app is handled by the Facebook SDK. There's no need to independently provide sign-in sheets and manage access token exchange between the app's local storage and Facebook's servers without the convenience of the entire Facebook SDK.
This link shows you how to implement SSO natively within your iOS app. It's real simple.
http://developers.facebook.com/docs/mobile/ios/build/#implementsso
Then, I understand that you're keeping authentication information or central user database information on an external server. The best way to synchronize the information between the FB client and your own servers is to simply check the login information returned by the FB SDK with your server after you receive it.
Here's a simple breakdown:
Log the user in using Facebook's standard SDK (see the link above).
In the -didLogin method (or whatever the equivalent is in your Adobe AIR environment), check the access token returned by FB with your server. Not sure what server architecture you're using, but it's safe to say that this will go on outside of the FB SDK. Also, save the access token in your app's user defaults so that the user won't have to login again next time. This whole process should (and inherently will) feel much quicker than it sounds.
If the check with the server returns successfully, notify the user of a successful login. If not, display an error view explaining the reason the user was rejected/not logged in.
Why do it this way? The reason is fairly simple. It's safe to assume that the reason you're having a user login to your app via Facebook is so that you can make requests for the user's Facebook information (i.e. feeds, photos, likes, comments, etc.). The easiest (and best) way to do this is through the FB SDK its self. The SDK takes care of a lot of stuff behind the scenes like access token validation over time, extension of token life, validity of token, and so on. This way, you won't have to worry nearly as much about syncronizing the server information and real-time client information when changes take place. Just authenticate via the FB iOS SDK, and do the rest of your own processing afterward.
Comment below if there's anything I should clarify or even if I missed the point of your question entirely--I tend to get on a roll and may stray from the point. :)
Cheers!
The Kraken
I'm fairly new to iOS development, and I'm starting work on an App that will include some simple Facebook integration. As a proof of concept, I made a bare-bones, view-based application that has a simple button to log a user in to Facebook, and then another button to post a status update.
This is all well and good, but in a real world scenario, a user shouldn't have to login to Facebook every time they want to use the Facebook-integrated features of my App. My question is this: how would I go about persisting a user's login to a file, or to a database for use in a later launch of my App?
Ideally this solution would use Facebook's iOS SDK, but I wouldn't be opposed to building my own authentication system using their Graph API. The advantage of using Facebook's official iOS SDK, though, is that it can use the login information already associated with the phone's Facebook application (if installed), or the login associated with facebook.com on mobile Safari.
I'm not providing my current source code, on the basis that this is a general enough question to not require the specifics of my Facebook SDK usage. However, if you think it would be helpful, I'd be more than happy to post my code.
Thanks!
you wouldn't do that. check out facebook SSO in their SDK ( see https://developers.facebook.com/docs/guides/mobile/ ). You request the facebook token everytime you use it or otherwise get an long-term (read: use access token offline_access) access token and persist this token to the NSUserDefaults for use in your app. ( see http://coffeeshopped.com/2011/01/saving-sessions-with-the-facebook-ios-sdk )